Jump to content

  • Log In with Google      Sign In   
  • Create Account


How can I use PhysFS?


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
5 replies to this topic

#1 Octav   Members   -  Reputation: 159

Like
0Likes
Like

Posted 29 September 2012 - 02:23 AM

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 Posted Image

Sponsor:

#2 ColinDuquesnoy   Members   -  Reputation: 1069

Like
3Likes
Like

Posted 29 September 2012 - 06:26 AM

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

Edited by renega_666, 29 September 2012 - 06:34 AM.


#3 Octav   Members   -  Reputation: 159

Like
0Likes
Like

Posted 29 September 2012 - 09:38 AM

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

Edited by Octav, 29 September 2012 - 09:53 AM.


#4 Cornstalks   Crossbones+   -  Reputation: 6966

Like
2Likes
Like

Posted 29 September 2012 - 12:14 PM

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.
[ 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 ]

#5 Octav   Members   -  Reputation: 159

Like
0Likes
Like

Posted 29 September 2012 - 12:51 PM


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.


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? Posted Image

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.

Edited by Octav, 29 September 2012 - 12:57 PM.


#6 kd7tck   Members   -  Reputation: 715

Like
0Likes
Like

Posted 29 September 2012 - 02:33 PM

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.




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS