Sign in to follow this  

Using PhysFS?

This topic is 4310 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Okay, I have been looking into PhysFS today. But, I need some help getting started. How exactly do I set up VC++ 2003 to use the PhysFS library? I'm talking about a standard C++ application, and not .NET or C#. I just need to know where to extract the files to, and how to link to the libraries, etc. Thanks in advance, Matt U.

Share this post


Link to post
Share on other sites
Read the INSTALL file from the source distribution, it should tell you all you need:
Quote:
From PhysFS 1.0.1
WIN32:
If building with CygWin, mingw32 or something else that uses the GNU
toolchain, follow the Unix instructions, above.

If you're using Visual C++ 6, point it at "physfs.dsp" in the root of the
source tree, and build. This will produce a "physfs.dll" and "physfs.lib"
(shared library and import lib, respectively) in either a "Debug" or
"Release" directory, depending on what configuration you chose to build.
After building the lib, you can make sure it works by building the
"test_physfs.dsp" project file, which will create "test_physfs.exe" in
"Debug" or "Release". This EXE is linked against the DLL you built
previously.

If you're using Visual C++ 6 and want to generate a static LIB file, point
it at "physfs_static.dsp" in the root of the source tree and build. This
will produce a "physfs_static.lib" in either a "physfs_static_debug"
or a "physfs_static_release" directory, depending on what configuration
you chose to build. NOPE: "test_physfs.dsp" does not work with the
statically linked build.

Visual Studio.NET users should do the same thing, but use the "physfs.vcproj"
and "test_physfs.vcproj" project files instead.


NOTE: to change build options such as which drivers are loaded (ZIP, QPAK,
etc.) modify the appropriate manifest constants under the Project Settings.
By default the LIB version supports all drivers, but the DLL build does
not support MVL or HOG file formats.

If you're using another compiler, send me a patch when you get it working. :)

No one's tried building this for a WinCE (PocketPC) platform, but it may or
may not work. Patches are welcome.

If someone is willing to maintain prebuilt PhysicsFS DLLs, I'd like to hear
from you; send an email to icculus@clutteredmind.org.
Feel free to ask more questions if you get stuck.


jfl.

Share this post


Link to post
Share on other sites
Well, when I try to compile the 'physfs' project (not the static lib. project), I get these three error:

C:\Development Libraries\physfs-1.1.0\physfs.c(585) : error C2220: warning treated as error - no object file generated

which points to:

char *mntpnt = (char *) alloca(strlen(mountPoint) + 1);

C:\Development Libraries\physfs-1.1.0\archivers\qpak.c(385) : error C2220: warning treated as error - no object file generated

which points to an error in "zip.c" as well, with this line (same in both files):

char *newstr = alloca(ln + 1);

I am using Visual C++ 6.0 to compile. And all I did was extract all the files, open the project, and press F7 to build. But that's what I get. Anyone have any idea, or had this problem before?

EDIT:
The following warning follows under each error message:

C:\Development Libraries\physfs-1.1.0\physfs.c(585) : warning C4013: 'alloca' undefined; assuming extern returning int

And it's the same thing (pointing to same line as error) in qpak.c and zip.c.

Share this post


Link to post
Share on other sites
Nevermind. I found a previous post, and just had to add "#include <malloc.h>" to the files in which the errors were occuring. Sorry for the post, and the answer was right there. Sorry. =P

Share this post


Link to post
Share on other sites

This topic is 4310 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this