Problem building sample program

Hi,
I’m trying to set up the dev environment to build a Linux SDL based
game. I’m using a standard Ubuntu 7.10 setup and installed SDL with
apt-get from the Debian repository.

To start simple I tried to build the example programs found in
/usr/share/doc/libsdl1.2-dev/examples/examples.tar.gz but the
configuration process fails thus:

---- paste ----
david at rabota:~/Dev/temp/test$ ./configure
configure: error: cannot find install-sh or install.sh in
./…/build-scripts
---- end paste ----
but build-scripts is not present.

Plan B was to make the simple testver.c program using this makefile:

-------- makefile --------
CC=gcc
CFLAGS=-I/usr/include/SDL -D_GNU_SOURCE=1 -D_REENTRANT
LDFLAGS=-L/usr/lib -lSDL

testver : testver.o
${CC} ${LDFLAGS} -o testver testver.o

testver.o : testver.c
${CC} ${CFLAGS} -c testver.c
--------- end makefile -------

But this too fails with this cryptic result:

---- paste ----
david at rabota:~/Dev/temp/test$ make
gcc -I/usr/include/SDL -D_GNU_SOURCE=1 -D_REENTRANT -c testver.c
gcc -L/usr/lib -lSDL -o testver testver.o
/usr/local/bin/ld: unrecognized option ‘–hash-style=both’
/usr/local/bin/ld: use the --help option for usage information
collect2: ld returned 1 exit status
make: *** [testver] Error 1
---- end paste ----

I have no idea where ‘–hash-style=both’ is coming from!
The only unusual thing I can think about my dev enviroment is I have the
gcc ARM tool chain installed too but they have ‘arm’ prefixed to the
tools so should not be the problem, I hope.

As per the FAQ docs here is some info on my system:

---- paste ----
david at rabota:~/Dev/temp/test$ which sdl-config
/usr/bin/sdl-config
david at rabota:~/Dev/temp/test$ sdl-config --version
1.2.11
david at rabota:~/Dev/temp/test$ locate libSDL
/usr/lib/libSDL_image-1.2.so.0
/usr/lib/libSDL-1.2.so.0
/usr/lib/libSDL.a
/usr/lib/libSDL.la
/usr/lib/libSDL_image-1.2.so.0.1.4
/usr/lib/libSDLmain.a
/usr/lib/libSDL.so
/usr/lib/libSDL-1.2.so.0.11.0
david at rabota:~/Dev/temp/test$ tail config.log

confdefs.h.

-----------

#define PACKAGE_NAME “”
#define PACKAGE_TARNAME “”
#define PACKAGE_VERSION “”
#define PACKAGE_STRING “”
#define PACKAGE_BUGREPORT “”

configure: exit 1
---- end paste ----

Any suggestions how get it working would be welcomed!

Thanks in advance–

David Annett


This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.

May be wrong compiler?
I was able to compile all sdl stuff, using arm-linux-gcc 3.4.1 with no problem.
I am using cross compile linux kernel using arm-elf-gcc 4.1, but all applications
(rootfs, busybox, sdl, nano-X, …) are cross compiled with arm-linux-gcc 3.4.1 flawlessy.
I never tried to use arm-elf-gcc 4.1 to cross compile other than kernel, so
I dunno if it can be a problem here.

Best regards,On Wednesday 05 March 2008 10:21, David Annett wrote:

david at rabota:~/Dev/temp/test$ make
gcc -I/usr/include/SDL -D_GNU_SOURCE=1 -D_REENTRANT -c testver.c
gcc -L/usr/lib -lSDL -o testver testver.o
/usr/local/bin/ld: unrecognized option ‘–hash-style=both’
/usr/local/bin/ld: use the --help option for usage information
collect2: ld returned 1 exit status
make: *** [testver] Error 1
I have no idea where ‘–hash-style=both’ is coming from!

Gianluca Renzi

Any suggestions how get it working would be welcomed!

Try to compile it manually:

gcc testver.c -lSDL -o testverAm Mittwoch, den 05.03.2008, 22:21 +1300 schrieb David Annett:

My target is standard PC, I only mention the ARM tools in case it was an
environment var or path problem.

gcc -v returns:

Using built-in specs.
Target: i486-linux-gnu
Configured with: …/src/configure -v
–enable-languages=c,c++,fortran,objc,obj-c++,treelang --prefix=/usr
–enable-shared --with-system-zlib --libexecdir=/usr/lib
–without-included-gettext --enable-threads=posix --enable-nls
–with-gxx-include-dir=/usr/include/c++/4.1.3 --program-suffix=-4.1
–enable-__cxa_atexit --enable-clocale=gnu --enable-libstdcxx-debug
–enable-mpfr --enable-checking=release i486-linux-gnu
Thread model: posix
gcc version 4.1.3 20070929 (prerelease) (Ubuntu 4.1.2-16ubuntu2)

Gianluca wrote:> On Wednesday 05 March 2008 10:21, David Annett wrote:

david at rabota:~/Dev/temp/test$ make
gcc -I/usr/include/SDL -D_GNU_SOURCE=1 -D_REENTRANT -c testver.c
gcc -L/usr/lib -lSDL -o testver testver.o
/usr/local/bin/ld: unrecognized option ‘–hash-style=both’
/usr/local/bin/ld: use the --help option for usage information
collect2: ld returned 1 exit status
make: *** [testver] Error 1
I have no idea where ‘–hash-style=both’ is coming from!

May be wrong compiler?
I was able to compile all sdl stuff, using arm-linux-gcc 3.4.1 with no problem.
I am using cross compile linux kernel using arm-elf-gcc 4.1, but all applications
(rootfs, busybox, sdl, nano-X, …) are cross compiled with arm-linux-gcc 3.4.1 flawlessy.
I never tried to use arm-elf-gcc 4.1 to cross compile other than kernel, so
I dunno if it can be a problem here.

Best regards,


This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.

That fails because SDL.h is not found but adding it include path gives
the same error:

david at rabota:~/Dev/temp/test$ gcc -I/usr/include/SDL testver.c -lSDL -o
testver
/usr/local/bin/ld: unrecognized option ‘–hash-style=both’
/usr/local/bin/ld: use the --help option for usage information
collect2: ld returned 1 exit status

Albert Zeyer wrote:> Am Mittwoch, den 05.03.2008, 22:21 +1300 schrieb David Annett:

Any suggestions how get it working would be welcomed!

Try to compile it manually:

gcc testver.c -lSDL -o testver


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.

Ah I see the error.

The ld which is used here is not the correct one. It seems you have
another ld installed in /usr/local/bin (where normally only manually
installed applications go into). Try to figure out which ld this is and
perhaps rename or delete it.

For a temporary solution, you can look where you have the correct ld
(probably at the same place where your gcc is). Set this path in your
PATH variable at the first position.

Probably like this:

export PATH=/usr/bin:$PATHAm Mittwoch, den 05.03.2008, 22:51 +1300 schrieb David Annett:

That fails because SDL.h is not found but adding it include path gives
the same error:

david at rabota:~/Dev/temp/test$ gcc -I/usr/include/SDL testver.c -lSDL -o
testver
/usr/local/bin/ld: unrecognized option ‘–hash-style=both’
/usr/local/bin/ld: use the --help option for usage information
collect2: ld returned 1 exit status

Albert Zeyer wrote:

Am Mittwoch, den 05.03.2008, 22:21 +1300 schrieb David Annett:

Any suggestions how get it working would be welcomed!

Try to compile it manually:

gcc testver.c -lSDL -o testver


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

We spotted! Many thanks :slight_smile:

I have renamed the offending file as ld1, in case I have broken
something else, and it all builds and runs ok now.

Great to get such quick answers, thanks again! :slight_smile:

Albert Zeyer wrote:> Ah I see the error.

The ld which is used here is not the correct one. It seems you have
another ld installed in /usr/local/bin (where normally only manually
installed applications go into). Try to figure out which ld this is and
perhaps rename or delete it.

For a temporary solution, you can look where you have the correct ld
(probably at the same place where your gcc is). Set this path in your
PATH variable at the first position.

Probably like this:

export PATH=/usr/bin:$PATH

Am Mittwoch, den 05.03.2008, 22:51 +1300 schrieb David Annett:

That fails because SDL.h is not found but adding it include path gives
the same error:

david at rabota:~/Dev/temp/test$ gcc -I/usr/include/SDL testver.c -lSDL -o
testver
/usr/local/bin/ld: unrecognized option ‘–hash-style=both’
/usr/local/bin/ld: use the --help option for usage information
collect2: ld returned 1 exit status

Albert Zeyer wrote:

Am Mittwoch, den 05.03.2008, 22:21 +1300 schrieb David Annett:

Any suggestions how get it working would be welcomed!

Try to compile it manually:

gcc testver.c -lSDL -o testver


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.