I'm trying to compile SDL-1.2.15 on Ubuntu 12.04
http://www.linuxfromscratch.org/blfs/view/svn/multimedia/sdl.html
The install guide says that I need to start by calling the configure file. Looking at the comments, this seems to be needed to create a makefile with which to compile the library. So, I start by typing:
sudo sh ./configure
To which I get the following error message:
checking build system type... i686-pc-linux-gnu
checking host system type... i686-pc-linux-gnu
checking for gcc... gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... configure: error: cannot run C compiled programs.
If you meant to cross compile, use `--host'.
See `config.log' for more details.
I've checked the log file (see below), but have been unable to determine the underlying problem. Any ideas on how to proceed?
This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake.
It was created by configure, which was generated by GNU Autoconf 2.61. Invocation command line was
$ ./configure
## --------- ##
## Platform. ##
## --------- ##
hostname = ubuntu
uname -m = i686
uname -r = 3.2.0-24-generic-pae
uname -s = Linux
uname -v = #39-Ubuntu SMP Mon May 21 18:54:21 UTC 2012
/usr/bin/uname -p = unknown
/bin/uname -X = unknown
/bin/arch = unknown
/usr/bin/arch -k = unknown
/usr/convex/getsysinfo = unknown
/usr/bin/hostinfo = unknown
/bin/machine = unknown
/usr/bin/oslevel = unknown
/bin/universe = unknown
PATH: /usr/local/sbin
PATH: /usr/local/bin
PATH: /usr/sbin
PATH: /usr/bin
PATH: /sbin
PATH: /bin
## ----------- ##
## Core tests. ##
## ----------- ##
configure:2136: checking build system type
configure:2154: result: i686-pc-linux-gnu
configure:2176: checking host system type
configure:2191: result: i686-pc-linux-gnu
configure:2261: checking for gcc
configure:2277: found /usr/bin/gcc
configure:2288: result: gcc
configure:2526: checking for C compiler version
configure:2533: gcc --version >&5
gcc (Ubuntu/Linaro 4.6.3-1ubuntu5) 4.6.3
Copyright (C) 2011 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
configure:2536: $? = 0
configure:2543: gcc -v >&5
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/i686-linux-gnu/4.6/lto-wrapper
Target: i686-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu/Linaro 4.6.3-1ubuntu5' --with-bugurl=file:///usr/share/doc/gcc-4.6/README.Bugs --enable-languages=c,c++,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-4.6 --enable-shared --enable-linker-build-id --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.6 --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-gnu-unique-object --enable-plugin --enable-objc-gc --enable-targets=all --disable-werror --with-arch-32=i686 --with-tune=generic --enable-checking=release --build=i686-linux-gnu --host=i686-linux-gnu --target=i686-linux-gnu
Thread model: posix
gcc version 4.6.3 (Ubuntu/Linaro 4.6.3-1ubuntu5)
configure:2546: $? = 0
configure:2553: gcc -V >&5
gcc: error: unrecognized option '-V'
gcc: fatal error: no input files
compilation terminated.
configure:2556: $? = 4
configure:2579: checking for C compiler default output file name
configure:2606: gcc conftest.c >&5
configure:2609: $? = 0
configure:2647: result: a.out
configure:2664: checking whether the C compiler works
configure:2674: ./a.out
./configure: line 2675: ./a.out: Permission denied
configure:2677: $? = 126
configure:2686: error: cannot run C compiled programs.
If you meant to cross compile, use `--host'.
See `config.log' for more details.
./configure
. Is it true for any script/application? This might be the clue to why you're having this problem. – Vitalie Ciubotaru Jun 02 '12 at 16:21./configure
and runs with no errors. I really believe that the problem is not in SDL, but instead is somewhere in your system settings (after all, you should be able to run ./configure). – Vitalie Ciubotaru Jun 02 '12 at 16:59sh
. For the same reason gcc tests failed. As a conclusion, (1) compile on the native Linux partition (say, inside your Ubuntu home directory, (2) try to do as you can withoutsudo
. – Vitalie Ciubotaru Jun 02 '12 at 20:09