Author Topic: Can't link object file from another project  (Read 26798 times)

Offline Aleksandr

  • Multiple posting newcomer
  • *
  • Posts: 21
Re: Can't link object file from another project
« Reply #15 on: June 18, 2014, 09:53:39 pm »
But no it is not implemented.

But I've added the library (.a) through dialog "Add files..." and when linking got the same error. Something tells me that the fix will affect on it too.

You can add the object file manually in the other linker options, but I don't see how this is a problem or how this is confusing.
No one is forcing you to put anything there, but if you need to pass something special to the linker you can do it.

I also added the object files (.o), along with the libraries (.a) in the List of libraries in the Linker settings tab, and all is well be linked. Without the use of Other linker options.

More and more I begin to think that I'm the one who does some things are not as expected. ;-)
[AAAA|+}

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re:
« Reply #16 on: June 18, 2014, 10:16:54 pm »
The library case was not implementeby me on purpose.instead a warning message will occur if you try. Libraries have to be added through the linker options as the order matters here which cannot be correctly computed otherwise. Adding libraries via"add file"simply makes no sense.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline scarphin

  • Lives here!
  • ****
  • Posts: 644
Re: Can't link object file from another project
« Reply #17 on: June 18, 2014, 10:24:03 pm »
Why don't you just add the corresponding source files from the library sources to your project? Then you will have only the needed part of your library in your project.

As I wrote before, it does not need to compile. Why do the same job twice?
Well, your proposal is just another way. You can come up with some exotic such as symlinks or something more sophisticated. But ask a question. Why when linking, you think some objects as a given, and others as wrong? Are they bad or guilty? ;-)
Why compiling a SINGLE source file twice bothers you so much considering it won't even be compiled again when there is no change to it?

Offline Aleksandr

  • Multiple posting newcomer
  • *
  • Posts: 21
Re:
« Reply #18 on: June 18, 2014, 11:19:03 pm »
The library case was not implementeby me on purpose.instead a warning message will occur if you try. Libraries have to be added through the linker options as the order matters here which cannot be correctly computed otherwise. Adding libraries via"add file"simply makes no sense.

Ok.

Why compiling a SINGLE source file twice bothers you so much considering it won't even be compiled again when there is no change to it?

I do not know whether the translator will pick the correct idiom. It's something like cockroaches in my head. Pointless to fight them. Forget it, it's offtopic. :-)
[AAAA|+}