This is the mail archive of the cygwin-xfree@cygwin.com mailing list for the Cygwin XFree86 project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: OpenGL and GLX




Zbynek Winkler wrote:
Alexander Gottwald wrote:

On Wed, 12 Nov 2003, Zbynek Winkler wrote:


It seems the linker is not using the libraries at all :-(.
Zbynek

$ g++ -I/usr/X11R6/include -L/usr/X11R6/lib -lX11 -lGL -Wl,-t glxsample.cpp -o glxsample


reorder the arguments:

$ g++ glxsample.cpp -I/usr/X11R6/include -L/usr/X11R6/lib -lX11 -lGL -o glxsample


Thanks. That actually works! Would you have a hint as to why the order is important?
Also would you know how to fix this command that shows the same symptoms?

Because on Cygwin the linker looks at each object file and library in sequential order and compiles a list of undefined symbols. It only attempts to resolve these symbols in objects and libraries that have not been processed yet. Any symbols not required by previous objects or libraries are not preserved for later objects/libraries to use.


Thus, if -lGL uses -lX11 symbols, then you must first include -lGL so that it sets up a list of unresolved symbols that will be resolved when -lX11 is processed next.

Does that make sense?

Harold


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]