Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

I've been trying to get a simple Hello World working with ClanLib using CDT (Eclipse), but I'm just not getting it configured properly.

First, from the command line, I'm able to get it to run using this command:

g++ -o mygame mygame.cpp `pkg-config --cflags --libs clanCore-2.3 clanDisplay-2.3 clanGL-2.3 clanGL1-2.3 clanApp-2.3` -lpthread

So no problems there.

Anyways, I tried setting up the correct build settings in Eclipse, but I just don't know where I'm supposed to add the info for the libraries. I tried adding it in the linker section, that didn't work. I tried a bunch of other things, nothing seemed to work...

Help would be appreciated, possibly as comprehensive as possible... I'm open to alternatives to Eclipse too. And the only reason this is such a problem is because this is the first time I'm trying to start a bigger C++ project, and I decided perhaps it's best to use some tools to make it a little easier, rather than a basic text editor (especially for debugging).

Oh, and I'm running Ubuntu, if that makes a difference. I'm really surprised there aren't any tutorials for setting up ClanLib in a development environment as popular as Eclipse...

share|improve this question
add comment

1 Answer 1

There are two places you need to do this to be sure that things will work, both of them are under Project->Properties->C/C++ Build->Settings->(MinGW) C++ Linker (assuming you're using MinGW):

  1. ->Libraries: add name of each lib you need without -l.
  2. ->Miscellaneous->Linker flags: add name of each lib you need in this textfield with -l prepended in every instance.

And of course under Libraries, make sure you have set up your library search paths (usually "yourlib/lib" -- I would use absolute paths here, and make sure they're enclosed in double quotes.

PS. Check the Console window to see what Eclipse is outputting for the g++ command.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.