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

Author Topic: Building SFML 2.0  (Read 3890 times)

0 Members and 1 Guest are viewing this topic.

JayArby

  • Jr. Member
  • **
  • Posts: 68
    • View Profile
Building SFML 2.0
« on: November 15, 2011, 08:55:46 pm »
I am trying to build SFML 2.0. I have put all the files into a Code::Blocks project. The entire project builds, but it will not link. I get a lot of undefined references to __imp___glewSomethingOrOther.

I am linking all the third party libraries, including libglew.a. I have googled this problem a thousand times but I cannot figure out what libs I am missing. Can anyone help me with this problem?

Groogy

  • Hero Member
  • *****
  • Posts: 1469
    • MSN Messenger - groogy@groogy.se
    • View Profile
    • http://www.groogy.se
    • Email
Building SFML 2.0
« Reply #1 on: November 15, 2011, 09:38:40 pm »
Developer and Maker of rbSFML and Programmer at Paradox Development Studio

JayArby

  • Jr. Member
  • **
  • Posts: 68
    • View Profile
Building SFML 2.0
« Reply #2 on: November 15, 2011, 09:52:58 pm »
I looked at it, but if at all possible I would like to avoid dealing with CMake and other such undocumented command-line build programs. There are a zillion of them out there, and it is a lot easier to use a project file generated by a good IDE (which are often importable between foreign IDEs). I don't know how to read the CMake makefiles, and I really don't want to take the time to learn it if I don't have to. All I need to know is what library I am missing.

Groogy

  • Hero Member
  • *****
  • Posts: 1469
    • MSN Messenger - groogy@groogy.se
    • View Profile
    • http://www.groogy.se
    • Email
Building SFML 2.0
« Reply #3 on: November 15, 2011, 10:31:20 pm »
You obviously don't know what Cmake is. Just follow the tutorial.
Developer and Maker of rbSFML and Programmer at Paradox Development Studio

JayArby

  • Jr. Member
  • **
  • Posts: 68
    • View Profile
Building SFML 2.0
« Reply #4 on: November 15, 2011, 10:38:32 pm »
You are correct that I am certainly no expert on cmake; however, that is not the point (although I have read through the tutorial). I would like to build SFML in a Code::Blocks project. I cannot imagine why this would be impossible. All I need to know is what libraries I am missing, not how to use cmake.

If anyone can help me with this, I would greatly appreciate it! :)

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Building SFML 2.0
« Reply #5 on: November 15, 2011, 11:12:42 pm »
CMake is the official way to build SFML 2. There's no other way. If you want Code::Blocks projects (I don't know why, you don't need to edit SFML sources do you?) then CMake will generate them for you. That's what CMake is for, generating build files. Not compiling directly.

By the way, CMake is documented and has a GUI front-end. Don't reject it just because you don't know it. Just try it. Everybody can follow the tutorial, and get SFML compiled in a matter of minutes.
Laurent Gomila - SFML developer

JayArby

  • Jr. Member
  • **
  • Posts: 68
    • View Profile
Building SFML 2.0
« Reply #6 on: November 16, 2011, 12:17:01 am »
Okay, thanks.

(for the record, I don't reject it just because I don't know it; my tendency is to reject such tools because there are so many tools like this and everyone uses a different one. I am not just saying this; this has been my experience. I don't like figuring out a new tool every single time I want to compile some C++ code. But if that's the only way, guess I'll go figure it out...)

Groogy

  • Hero Member
  • *****
  • Posts: 1469
    • MSN Messenger - groogy@groogy.se
    • View Profile
    • http://www.groogy.se
    • Email
Building SFML 2.0
« Reply #7 on: November 16, 2011, 12:39:08 am »
There's.... no figuring out.... It's 5 steps.

  • Write path to project
  • Press button
  • Choose what you want to compile with(in your case code::blocks)
  • Press button
  • Press button
And your done forever till Laurent introduces a new file into the library or somehow changes the hierarchy/structure. Your doing it more complex than it really is.

Cmake according to me pretty much does everything for you. Even if you have things placed at odd locations on the computer. I have the experience you have as well. Configuring the V8 engine for MinGW is hell.. No wait it makes hell freeze(And no hawt demon babes) and then bitch slap you. Cmake is a blessing according to me. Cmake does so much more so I don't even want to compare it to SCons and other build generation tools. Oh wait, SCons is a whole build system, I guess I can't compare them :P
Developer and Maker of rbSFML and Programmer at Paradox Development Studio

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Building SFML 2.0
« Reply #8 on: November 16, 2011, 07:54:01 am »
Quote
my tendency is to reject such tools because there are so many tools like this and everyone uses a different one

There are only a few tools like CMake, actually. It's very different from autotool, scons, etc. It's not a build tool, it's a build files generator.

You'd like to have a SFML project that you can open in your favorite IDE. That's fine. But how do I generate and maintain such build files? How do I ensure that it has the exact same behaviour as the build files for all other platforms that people use? It would be crazy to maintain a build file for every supported OS/compiler (there would be ~10 of them). That's where CMake helps: from a single definition, it can generate makefiles or projects for whatever tool/IDE you like. And the best thing is that you only need to run it once: after that, if SFML build files are updated, your project/makefile will automatically apply the changes to itself.

So in fact CMake makes it possible for you to work with your favorite tools, it doesn't replace them. Without it, I would have to "reject some build tools because there are so many and everybody uses a different one" ;)
Don't misunderstand its purpose.
Laurent Gomila - SFML developer

sec_goat

  • Newbie
  • *
  • Posts: 17
    • View Profile
Building SFML 2.0
« Reply #9 on: November 16, 2011, 04:28:22 pm »
Quote from: "Groogy"
Have you followed this tutorial? http://www.sfml-dev.org/tutorials/2.0/compile-with-cmake.php


I don't want to thread hijack, but I am having some issues comprehending the completed product after i use Cmake for SFML 2.0.

I am left with 2 folders: the one i unzipped to and the one I made to.
However I do not see any folder that has the same contents as when I download and use SFML 1.6.

How do I go from this tutorial to the setting it up for your compiler tutorial a-la 1.6 http://www.sfml-dev.org/tutorials/1.6/start-cb.php

thanks!

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Building SFML 2.0
« Reply #10 on: November 16, 2011, 04:36:08 pm »
Quote
I don't want to thread hijack

But you did :roll:
If my answer doesn't solve your problem, please open a new thread.

Quote
However I do not see any folder that has the same contents as when I download and use SFML 1.6

You must install SFML.

It's clearly written in the tutorial...
Quote
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.
Laurent Gomila - SFML developer

sec_goat

  • Newbie
  • *
  • Posts: 17
    • View Profile
Building SFML 2.0
« Reply #11 on: November 16, 2011, 04:37:39 pm »
Quote from: "Laurent"
Quote
I don't want to thread hijack

But you did :roll:
If my answer doesn't solve your problem, please open a new thread.

Quote
However I do not see any folder that has the same contents as when I download and use SFML 1.6

You must install SFML.

It's clearly written in the tutorial...
Quote
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.


I apologize, I meant I don't want to take this off topic, but I also don't want to flood the forums with duplicate posts. I will go back and re-read the tutorial and try to comprehend it better, and as always thank you for your hard work and help!

EDIT: Aha yes, I should have known that Make Install! it just threw me because I am on windows and not used to having to make or make install on windows. . .

 

anything