Hi,
I’m having a lot of trouble getting a sample SDL program to link. I’m
first creating the object file and then falling into troubles at the
2nd step. Here are my comands:
sh4-linux-g++ -c lesson02.cpp
-I/usr/local/sh4-linux-dev/tools-0010/sh4-linux/include/SDL
-D_REENTRANT -I/usr/local/sh4-linux-dev/tools-0010/sh4-linux/usr/X11R6/include
This works fine…
sh4-linux-g++ -o lesson02 lesson02.o
-L/usr/local/sh4-linux-dev/tools-0010/sh4-linux/lib
-Wl,-rpath,/usr/local/sh4-linux-dev/tools-0010/sh4-linux/lib -lSDL
-lpthread -lX11
-L/usr/local/sh4-linux-dev/tools-0010/sh4-linux/usr/X11R6/lib
But this is where it fails with the output:
/UNIONFS/usr/local/sh4-linux-dev/tools-0010/bin/…/lib/gcc/sh4-linux/3.4.4/…/…/…/…/sh4-linux/bin/ld:
warning: libXext…6, needed by
/usr/local/sh4-linux-dev/tools-0010/sh4-linux/lib/libSDL.so, not found
(try using -rpath or -rpath-link)
/usr/local/sh4-linux-dev/tools-0010/sh4-linux/lib/libSDL.so: undefined
reference to XShmDetach' /usr/local/sh4-linux-dev/tools-0010/sh4-linux/lib/libSDL.so: undefined reference to
XextAddDisplay’
/usr/local/sh4-linux-dev/tools-0010/sh4-linux/lib/libSDL.so: undefined
reference to XextFindDisplay' /usr/local/sh4-linux-dev/tools-0010/sh4-linux/lib/libSDL.so: undefined reference to
XShmCreateImage’
/usr/local/sh4-linux-dev/tools-0010/sh4-linux/lib/libSDL.so: undefined
reference to XShmPutImage' /usr/local/sh4-linux-dev/tools-0010/sh4-linux/lib/libSDL.so: undefined reference to
XShmAttach’
/usr/local/sh4-linux-dev/tools-0010/sh4-linux/lib/libSDL.so: undefined
reference to XextCreateExtension' /usr/local/sh4-linux-dev/tools-0010/sh4-linux/lib/libSDL.so: undefined reference to
XShmQueryExtension’
/usr/local/sh4-linux-dev/tools-0010/sh4-linux/lib/libSDL.so: undefined
reference to XextRemoveDisplay' /usr/local/sh4-linux-dev/tools-0010/sh4-linux/lib/libSDL.so: undefined reference to
XMissingExtension’
I don’t understand why the library cannot be found, even though I’ve
included it with the -L in my linker statement…
I’m not too knowledgealble about this, so any help would really be great!!
Thank you,
chris