User forums > Help

link order?

(1/1)

roxlu:
hi, I've added a static lib added to my Build Options > Linker Settings > Other linker options list, like "../../../addons/ofxOsc/libs/oscpack/lib/win32/oscpack.a". I added this at the bottom of the list which resulted in linker errors that it
couldnt fnd hton_* etc..

I solved this by moving the line the oscpack.a in the other linker options list to just above -lws2_32.
Now, I'm wondering why this solved it?

I can also solve this problem by added libws2_32.a to the Compiler settings.

roxlu

MortenMacFly:

--- Quote from: roxlu on August 09, 2009, 11:01:28 pm ---Now, I'm wondering why this solved it?

--- End quote ---
Order matters when linking. If liba requires libb than you cannot link libb before liba as the linker cannot resolve the symbols.

mariocup:
Hi roxlu,

the linker can also automatically resolve cyclic references so that the order of libraries be-
comes irrelevant. The corresponging linker option is


--- Code: ----Wl,--start-group <list> -Wl,--end-group.

--- End code ---

<list> is used here a placeholder for your list of libraries.

You have to specify this option in the other linker settings.

thomas:

--- Quote from: mariocup on August 10, 2009, 12:55:21 pm ---the linker can also automatically resolve cyclic references so that the order of libraries be-
comes irrelevant.
--- End quote ---
Don't use that unless you can't do otherwise though, as this will take about 10-15 times as long to link.

Navigation

[0] Message Index

Go to full version