User forums > General (but related to Code::Blocks)

building a static library can not link to a library

(1/1)

wanggeng:
I am going to build a static library(libC6Lib.a), and this library has to be linked with a previous build library(test_head.lib).
I add the library file into [project options]->[linker settings]->[link libraries] and add library's path into [project options]->[search directories]->[linker].
I open the option "save build log to HTML file when build is finished".
However, I only get the following link command:

c6runlib_codeblock_ar -r -s libC6Lib.a obj/Debug/main.o

the test_head.lib is not in command line, and I can not remove the "-r" either "-s" option.

who can help me. Thank You!

zabzonk:
Static libraries do not link to other libraries - they are just archives of object files.

wanggeng:
Well, Thank you. But my compiler is special, it need an library file to generate its library. How can I the set up the Code::Blocks IDE to generate command line like this:

c6runlib_codeblock_ar -r -s libC6Lib.a obj/Debug/main.o test_head.lib

oBFusCATed:
You can edit the compiler/linker commands in Settings->Compiler -> Your compiler -> Other settings -> Advanced

Navigation

[0] Message Index

Go to full version