Code::Blocks Forums
Developer forums (C::B DEVELOPMENT STRICTLY!) => Development => Topic started by: mbu on June 14, 2008, 03:27:06 pm
-
Hi,
can anyone please tell me how to statically link a library using codeblocks?
Thanks, mbu.
-
Has been solved. Thank you.
-
So what is the answer, I can't see any way of doing it?
Cheers, Mike
-
I'm also looking for a solution to link some libs like boost statically in codeblocks.
If I add -static to "other linker commands" I get an error "-Wl not found"
I found lots of pages on the internet that tell how to do it on the commandline, but I would like to do it in my codeblocks project.
Rgds
Richard
-
Either use the full libray name in the Link Libraries section on the Linker Settings tab, for example:
../../../../thirdparty/boost/lib/libboost_date_time-gcc42-mt.a
or don't use the Link Libraries at all and manually enter your linker settings in the 'Other Linker Options...' window using the -Xlinker. For example,
-Xlinker -Bstatic
-l<some_boost_static_library>
-l<more_static_libraries>
-Xlinker -Bdynamic
-lpthread
-l<more_dynamic_libraries>
-
thanks gryphon.
I'm one step further now, and understand a bit more how these things work under linux and codeblocks.
Rgds
Richard