Page 1 of 1

SFML static linking

Posted: Sun Dec 29, 2013 5:27 am
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.

Re: SFML static linking

Posted: Sun Dec 29, 2013 8:06 pm
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.

Re: SFML static linking

Posted: Mon Dec 30, 2013 12:13 am
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.