SFML community forums

Help => General => Topic started by: mimipim on March 20, 2011, 07:15:16 pm

Title: SFML 2 with C::B
Post by: mimipim on March 20, 2011, 07:15:16 pm
Hi. When i download sfml2 theres no lib folder.
How to setup sfml2 to work with C::B?
Title: SFML 2 with C::B
Post by: Laurent on March 20, 2011, 07:53:01 pm
You must compile it, there's no release yet.
Title: SFML 2 with C::B
Post by: mimipim on March 20, 2011, 08:05:41 pm
Can you explane me how to do this?
Title: SFML 2 with C::B
Post by: Laurent on March 20, 2011, 08:45:54 pm
There's one tutorial for SFML 2 on the website, and guess what, it's explained inside ;)
Title: SFML 2 with C::B
Post by: mimipim on March 24, 2011, 08:51:49 am
Okay. I try to do what is explained in tutorial but I can't understand where is this PATH=%PATH%;.........

When I try to build it with cmake I get errors:
(http://store.picbg.net/pubpic/A4/85/f02f4dab2879a485.png)

I hope someone help me to build SFML2 :?
Title: SFML 2 with C::B
Post by: Laurent on March 24, 2011, 09:18:27 am
Quote
I can't understand where is this PATH=%PATH%;.........

You must type these commands in a command prompt.

(http://www.bleepstatic.com/tutorials/cmdprompt/cmdprompt.gif)

And please use smaller screenshots, not everybody has a wide screen ;)
Title: SFML 2 with C::B
Post by: mimipim on March 24, 2011, 09:45:39 am
Okay. I do this.. maybe have a progress but still give errors(with CmakeList):

(http://store.picbg.net/pubpic/C2/40/bddb761a46cec240.png)
Title: SFML 2 with C::B
Post by: Laurent on March 24, 2011, 09:48:30 am
You must run the top-level CMakeLists.txt, not the one in src/SFML.
Title: SFML 2 with C::B
Post by: mimipim on March 24, 2011, 10:12:08 am
Okay I generate it(lib folder is empty).
Next step is to run mingw32-make but I don't understand what arguments exactly to put?
Title: SFML 2 with C::B
Post by: Laurent on March 24, 2011, 10:18:09 am
It's clearly explained in the tutorial
Quote
Here are all the targets that are available, depending on the configure options that you chose:

    * all
      This is the default target, it is used if no target is explicitely specified. It builds all the targets that produce a binary (sfml libraries and examples).

    * sfml-system, sfml-window, sfml-network, sfml-graphics, sfml-audio, sfml-main
      Builds the corresponding SFML library. The "sfml-main" target is available only on Windows systems.

    * ftp, opengl, pong, shader, sockets, sound, sound-capture, voip, window, win32, X11
      Builds the corresponding SFML example. These targets are available only if the BUILD_EXAMPLES option is enabled. Note that some of the targets are available only on a certain OS ("win32" is available on Windows, "X11" on Linux, etc.).

    * doc
      Generates the API documentation. This target is available only if the BUILD_DOC option is enabled.

    * clean
      Removes all the object files produced by a previous compilation. You generally don't need to invoke this target, except when you want to recompile SFML completely (some updates may mess up with object files already compiled, and cleaning everything is the only solution).

    * install
      Installs SFML to the path defined in the CMAKE_INSTALL_PREFIX option. It copies the SFML libraries and headers, as well as examples and documentation if the BUILD_EXAMPLES and BUILD_DOC options are enabled. After installing, you get a clean distribution of SFML, just as if you had downloaded the SDK or installed it from the system repositories.


The most important one is the first:
Quote
* all
This is the default target, it is used if no target is explicitely specified.


So:
Quote
mingw32-make

... is all you need to type to compile SFML. Optionally followed by a "mingw32-make install" if you want a clean install (and have set the CMAKE_INSTALL_PREFIX variable to something relevant).
Title: SFML 2 with C::B
Post by: mimipim on March 24, 2011, 10:22:50 am
I already try this:
(http://store.picbg.net/pubpic/49/47/3c9525c6528d4947.png)

Maybe im missing something :?
Title: SFML 2 with C::B
Post by: Laurent on March 24, 2011, 11:31:31 am
You must do it from the directory where the makefiles were generated... mingw-make won't find anything to process in C:\ ;)
Title: SFML 2 with C::B
Post by: mimipim on March 24, 2011, 11:57:39 am
Thanks for your help Laurent. (I hope this topic will be useful for other members).
I got it now.  :lol:
Title: SFML 2 with C::B
Post by: mimipim on March 24, 2011, 07:35:27 pm
Oooh.. god :?
I hate these errors:
Code: [Select]
Release\Engine.o:Engine.cpp:(.text+0x19d5): undefined reference to `_imp___ZN2sf5ImageD1Ev'
Release\Engine.o:Engine.cpp:(.text+0x1a79): undefined reference to `_imp___ZTVN2sf6SpriteE'
Release\Engine.o:Engine.cpp:(.text+0x1aad): undefined reference to `_imp___ZN2sf8DrawableD2Ev'
Release\Engine.o:Engine.cpp:(.text+0x1abc): undefined reference to `_imp___ZN2sf5ImageD1Ev'
Release\Engine.o:Engine.cpp:(.text+0x1bb8): undefined reference to `_imp___ZN2sf5ImageD1Ev'
(theres more)

I think this mean that something is not linked or... ?!
What I do after Build SFML2:
C::B Compiler and Debuger settings->
    Search Directories->
        Compiler: C:\CPP\SFML2\include,
        Linker: C:\CPP\SFML2\lib;

Project->
    Build options->
        Release->
            Linker settings->
                Other linker options:
Code: [Select]
-lsfml-graphics-s
-lsfml-window-s
-lsfml-audio-s
-lsfml-system-s
-lsfml-network-s


Ideas?
Title: SFML 2 with C::B
Post by: Laurent on March 24, 2011, 08:17:16 pm
You must add SFML_STATIC to your preprocessor options.
Title: SFML 2 with C::B
Post by: mimipim on March 24, 2011, 09:49:39 pm
Quote from: "Laurent"
You must add SFML_STATIC to your preprocessor options.

Did you mean to add SFML_STATIC to my Global Compiler settings(compiler settings) #defines textarea?
I try it but theres no change :?
Title: SFML 2 with C::B
Post by: Laurent on March 24, 2011, 09:57:02 pm
Quote
Did you mean to add SFML_STATIC to my Global Compiler settings(compiler settings) #defines textarea?

Should be there, yes. Make sure that it is defined for the configuration that you use (Debug/Release).
Title: SFML 2 with C::B
Post by: mimipim on March 25, 2011, 09:52:31 am
Hmmm. I'm sure I check it a lot of times and I have only release because I remove debug.  :roll:
Title: SFML 2 with C::B
Post by: mimipim on March 25, 2011, 06:34:49 pm
The problem was something with .o files. I delete all of them and build my project again - that result to success  :wink:
(this .o files was created with SFML 1.6 maybe that was the problem)