Advertisement

How can I use PhysFS?

Started by September 29, 2012 08:23 AM
4 comments, last by kd7tck 12 years, 2 months ago
Hi.

While developing my game I figured I wanted to pack all my game resources in a .zip file or a .pak file so it looks a bit cleaner and organized, and I wanted to use PhysFS for that purpose. Well, truth is I'm a total beginner at this, I downloaded PhysFS, all I got was a bunch of headers and source files and I have to apparently build it to get a .lib or a .a file which I can link to in my code::Blocks project, but I am CLUELESS as to how to do that. I've never even used cmake or anything similar, can anyone guide me step-by-step as to building PhysFS for using it in my project?

Please, I've been looking for an answer everwhere, all I got was this link which is not even slightly helpful sad.png
CMake is a cross platform build system. The link you gave is a link to a tutorial that explains how to use cmake to create a simple project. You do not need to know that to build a cmake project.

I've never used PhysFS but I'm used to build cmake projects. Usually the build process is the following:
1. open a shell an navigate to the root of the project.
2. there, create a build directory (mkdir build) and navigate to it (cd build)
3. configure the project: cmake .. (before the .. you may add config options to specify the compiler and other options)
3.build the project: make (or nmake or mingw32-make depending on the compiler used)
4.install the project: make install
Advertisement

CMake is a cross platform build system. The link you gave is a link to a tutorial that explains how to use cmake to create a simple project. You do not need to know that to build a cmake project.

I've never used PhysFS but I'm used to build cmake projects. Usually the build process is the following:
1. open a shell an navigate to the root of the project.
2. there, create a build directory (mkdir build) and navigate to it (cd build)
3. configure the project: cmake .. (before the .. you may add config options to specify the compiler and other options)
3.build the project: make (or nmake or mingw32-make depending on the compiler used)
4.install the project: make install


Thanks a lot for the reply, but as I said it's my first time, I'm a total beginner so I don't know how to open a shell or create a build directory, could you tell me how to open a shell?

EDIT: after researching I found out what you meant by shell, You meant using the run feature. But the rest of the steps are still unknown to me

EDIT: after researching I found out what you meant by shell, You meant using the run feature. But the rest of the steps are still unknown to me

Actually, on Windows it's the "Command Prompt" (not "Run...", though you can start the Command Prompt by typing "cmd" into "Run..."). (I'm assuming you are on Windows)

If you're on Windows, just use the CMake GUI (run CMakeSetup.exe, which should be in your Start menu). Here's a nifty tutorial on running CMake. Using CMake through the GUI is easiest. If you have specific questions from that link I just posted, feel free to ask.
[size=2][ I was ninja'd 71 times before I stopped counting a long time ago ] [ f.k.a. MikeTacular ] [ My Blog ] [ SWFer: Gaplessly looped MP3s in your Flash games ]

[quote name='Octav' timestamp='1348933107' post='4985085']
EDIT: after researching I found out what you meant by shell, You meant using the run feature. But the rest of the steps are still unknown to me

Actually, on Windows it's the "Command Prompt" (not "Run...", though you can start the Command Prompt by typing "cmd" into "Run..."). (I'm assuming you are on Windows)

If you're on Windows, just use the CMake GUI (run CMakeSetup.exe, which should be in your Start menu). Here's a nifty tutorial on running CMake. Using CMake through the GUI is easiest. If you have specific questions from that link I just posted, feel free to ask.
[/quote]

Alright what I did was:
Set the source code in Cmake GUI to "F:/CodeBlocks/physfs-2.0.2"
and build the binaries at "F:/CodeBlocks/physfs-2.0.2/build"

However when running it's giving me "The application has failed to start because libgmp-10.dll was not found." 5 times, after which it starts to configure, but before it ends it gives me this error: "Error in configuration process. Project files may be invalid".

What to do? sad.png

EDIT: I do have the environmental variables set correctly
Error code:

CMake Error at C:/Documents and Settings/Stefan.MONA-H6H4KPUJNF/Desktop/cmake-2.8.9-win32-x86/share/cmake-2.8/Modules/CMakeTestCCompiler.cmake:52 (MESSAGE):
The C compiler "c:/mingw/bin/gcc.exe" is not able to compile a simple test
program.
From within CMake GUI, you can enter the location of libraries needed to compile. Make sure you append that directory with libgmp-10.dll into the list.
Make sure to add all the bin/exe folders everywhere on your system into your system path.
I noticed the cmake file in version 2.0.2 has a typo in it. Use an earlier version, or fix the typo yourself.

I hope this helps you.

This topic is closed to new replies.

Advertisement