Developer forums (C::B DEVELOPMENT STRICTLY!) > Development

static linking in codeblocks

(1/2) > >>

mbu:
Hi,

can anyone please tell me how to statically link a library using codeblocks?

Thanks, mbu.

mbu:
Has been solved. Thank you.

mdurham:
So what is the answer, I can't see any way of doing it?
Cheers, Mike

ulrichard:
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

gryphon:
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>

Navigation

[0] Message Index

[#] Next page

Go to full version