Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: SFML 2 with C::B  (Read 5196 times)

0 Members and 3 Guests are viewing this topic.

mimipim

  • Newbie
  • *
  • Posts: 49
    • View Profile
SFML 2 with C::B
« 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?

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
SFML 2 with C::B
« Reply #1 on: March 20, 2011, 07:53:01 pm »
You must compile it, there's no release yet.
Laurent Gomila - SFML developer

mimipim

  • Newbie
  • *
  • Posts: 49
    • View Profile
SFML 2 with C::B
« Reply #2 on: March 20, 2011, 08:05:41 pm »
Can you explane me how to do this?

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
SFML 2 with C::B
« Reply #3 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 ;)
Laurent Gomila - SFML developer

mimipim

  • Newbie
  • *
  • Posts: 49
    • View Profile
SFML 2 with C::B
« Reply #4 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:


I hope someone help me to build SFML2 :?

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
SFML 2 with C::B
« Reply #5 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.



And please use smaller screenshots, not everybody has a wide screen ;)
Laurent Gomila - SFML developer

mimipim

  • Newbie
  • *
  • Posts: 49
    • View Profile
SFML 2 with C::B
« Reply #6 on: March 24, 2011, 09:45:39 am »
Okay. I do this.. maybe have a progress but still give errors(with CmakeList):


Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
SFML 2 with C::B
« Reply #7 on: March 24, 2011, 09:48:30 am »
You must run the top-level CMakeLists.txt, not the one in src/SFML.
Laurent Gomila - SFML developer

mimipim

  • Newbie
  • *
  • Posts: 49
    • View Profile
SFML 2 with C::B
« Reply #8 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?

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
SFML 2 with C::B
« Reply #9 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).
Laurent Gomila - SFML developer

mimipim

  • Newbie
  • *
  • Posts: 49
    • View Profile
SFML 2 with C::B
« Reply #10 on: March 24, 2011, 10:22:50 am »
I already try this:


Maybe im missing something :?

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
SFML 2 with C::B
« Reply #11 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:\ ;)
Laurent Gomila - SFML developer

mimipim

  • Newbie
  • *
  • Posts: 49
    • View Profile
SFML 2 with C::B
« Reply #12 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:

mimipim

  • Newbie
  • *
  • Posts: 49
    • View Profile
SFML 2 with C::B
« Reply #13 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?

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
SFML 2 with C::B
« Reply #14 on: March 24, 2011, 08:17:16 pm »
You must add SFML_STATIC to your preprocessor options.
Laurent Gomila - SFML developer