Author Topic: building a static library can not link to a library  (Read 7695 times)

Offline wanggeng

  • Single posting newcomer
  • *
  • Posts: 2
building a static library can not link to a library
« on: November 29, 2011, 05:23:54 pm »
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

  • Guest
Re: building a static library can not link to a library
« Reply #1 on: November 29, 2011, 05:41:45 pm »
Static libraries do not link to other libraries - they are just archives of object files.

Offline wanggeng

  • Single posting newcomer
  • *
  • Posts: 2
Re: building a static library can not link to a library
« Reply #2 on: November 30, 2011, 09:24:35 am »
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

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: building a static library can not link to a library
« Reply #3 on: November 30, 2011, 01:36:08 pm »
You can edit the compiler/linker commands in Settings->Compiler -> Your compiler -> Other settings -> Advanced
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]