User forums > Help

Specify libraries in correct order

<< < (2/3) > >>

Michael:

--- Quote from: tiwag on January 02, 2006, 06:35:05 pm ---didn't you ever fall into this pit ?

--- End quote ---
Hmmm. I was having some linking troubles with an wxWidgets application that did compile with M$, but not with GNU. But I thought it was because of my little experience with GNU. Now, I can check if it is an order problem :).

Anyway, and not to go too off-topic :), GNU seems to me more strict than M$. Experienced this when I have ported for the first time a M$ project that made use of templates to GNU.

Michael

xnhcoder:

--- Quote from: Michael on January 02, 2006, 06:10:09 pm ---Hmmm, the order of the libraries is important, but I have built (compiled&linked) wxWidgets applications where the M$ libraries did come before the wxWidgets ones.

--- End quote ---

Well, there I go again.  Saying the wxWidgets libraries "must" come before the Windows libraries is probably an overstatement.  My intent was just to show an example where order is crucial and to give users another line of investigation when the libraries themselves and their locations seem perfectly fine. 

grv575:

--- Quote from: xnhcoder on January 02, 2006, 08:10:34 pm ---wxWidgets libraries "must" come before the Windows libraries

--- End quote ---

The rule for gcc is that libraries on the command line must come before-be to the left of-any libraries they depend on.  They must be listed in reverse dependency order.

xnhcoder:

--- Quote from: tiwag on January 02, 2006, 06:26:48 pm ---rule of thumb for gcc :
[...]
2. wxwidgets libraries (order as shown in wx-samples !!!)
[...]

--- End quote ---

Yes, examining the "minimal" makefile and my experience with the importance of order when building GLUI-GLUT-OpenGL apps is what prompted me to try adjusting the order of the libraries.

xnhcoder:

--- Quote from: grv575 on January 02, 2006, 09:38:49 pm ---The rule for gcc is that libraries on the command line must come before-be to the left of-any libraries they depend on.  They must be listed in reverse dependency order.

--- End quote ---

But other than by being mentioned in a library's documentation or by trial-and-error, how can one determine a library's dependency?

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version