SFML static linking

General questions regarding the usage of CodeLite
Spirro
CodeLite Curious
Posts: 4
Joined: Fri Aug 03, 2012 7:59 am
Genuine User: Yes
IDE Question: c++
Contact:

SFML static linking

Post by Spirro »

So I'm doing more testing with Code Lite and I need a little help. I would like to test static linking to the SFML library. I have it compiled correctly and tested it with Code Blocks and know the libraries can link correctly. I'm following the Code Blocks directions on the SFML site at http://www.sfml-dev.org/tutorials/2.1/start-cb.php to come up with how to set Code Lite to compile statically. Checking the forums here I didn't see a topic for SFML specifically, but there were a couple for Linux(which I have tested dynamically with Code Lite, but will be testing as static as well). So far what I have come up with to try is to go to Settings-->Common Settings-->Linker and set options for 1);-SFML_STATIC 2);SFML_STATIC and 3);-static. Options 1 and 2 fail outright. Option 3 gives me a laundry list of error codes.

So what I'm asking is what would be the proper way to set Code Lite to statically link with SFML libraries and for future reference any static library. I'm currently working on Windows 7, but will be expanding to Linux soon. So this question pertains to the Windows environment.
User avatar
Jarod42
CodeLite Expert
Posts: 239
Joined: Wed Sep 30, 2009 5:54 pm
Genuine User: Yes
IDE Question: C++
Location: France
Contact:

Re: SFML static linking

Post by Jarod42 »

Project settings... -> Common settings -> linker
fill options, library path, and libraries.

if you have to add definition (macro), you can set them in compiler settings.
Spirro
CodeLite Curious
Posts: 4
Joined: Fri Aug 03, 2012 7:59 am
Genuine User: Yes
IDE Question: c++
Contact:

Re: SFML static linking

Post by Spirro »

I have compiled using dynamically linked libraries successfully. Setting up the linker and compiler settings for the project aren't a problem in that regard. To test static compiling I changed the linker libraries to the correct versions(-s-d suffixes as I'm using debug mode for this), but it fails. Could you elaborate on where to set a macro in the compiler settings? The closest match for your description was the tooltip on the preprocessor text field in the compiler settings. I tried it, despite doubts, and got 378 compile errors. Another hint would be helpful.
Post Reply