[ale] compile/linking problem

Dan Newcombe newcombe at mordor.clayton.edu
Thu Aug 7 09:53:47 EDT 1997


Can someone explain this to me.  I'm compiling Qt.  In the tutorials this
happens:
gcc main.o -o t2 -L/usr/lib/qt/lib -lqt -lm
/usr/X11R6/lib/libX11.so.6: undefined reference to `writev'
/usr/X11R6/lib/libX11.so.6: undefined reference to `strerror'
/usr/X11R6/lib/libX11.so.6: undefined reference to `snprintf'
/usr/X11R6/lib/libX11.so.6: undefined reference to `fscanf'
/usr/X11R6/lib/libX11.so.6: undefined reference to `sleep'
/usr/X11R6/lib/libX11.so.6: undefined reference to `wctomb'
/usr/X11R6/lib/libX11.so.6: undefined reference to `inet_addr'
/usr/X11R6/lib/libX11.so.6: undefined reference to `setsockopt'
/usr/X11R6/lib/libX11.so.6: undefined reference to `shutdown'
/usr/X11R6/lib/libX11.so.6: undefined reference to `gethostbyname'
/usr/X11R6/lib/libX11.so.6: undefined reference to `getservbyname'
/usr/X11R6/lib/libX11.so.6: undefined reference to `getpeername'
/usr/X11R6/lib/libX11.so.6: undefined reference to `rewind'
/usr/X11R6/lib/libX11.so.6: undefined reference to `atoi'
/usr/X11R6/lib/libX11.so.6: undefined reference to `fputs'
/usr/X11R6/lib/libX11.so.6: undefined reference to `getsockname'

However, when I change the line to
gcc main.o -o t2 -L/usr/lib/qt/lib -L/usr/X11R6/lib -lqt -lm -lX11
it works fine

What I don't understand is the stuff it can't find is all standard library
stuff, and it seems that it is finding the X11 libraries fine on it's own.
So why does adding those two additions make a difference?

I ask because apparently I'm the only one on the MindsEye mailing list
having this problem - for them, the -L/usr/X11R6/lib and -lX11 are not
needed.

Thanks

--
Dan Newcombe                                      newcombe at mordor.clayton.edu
"The fool who escaped from paradise will look over his shoulders and cry...So
I'll hold my peace forever when you wear your bridal gown."   -Marillion






More information about the Ale mailing list