LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   gcc compiler problem (https://www.linuxquestions.org/questions/linux-newbie-8/gcc-compiler-problem-461163/)

greengrocer 07-05-2006 06:32 AM

gcc compiler problem
 
I am trying to configure ALSA, when I type in:

sh configure --with-cards=hda-intel --with-sequencer=yes --with-oss=yes

I get the following error:

checking for gcc... /usr/bin/gcc
checking for C compiler default output file name... configure: error: C compiler cannot create executables
See `config.log' for more details.


Does anybody know what causes this?

raskin 07-05-2006 06:57 AM

first, you post config.log
second, you can read it yourself and find the error near the end - and try to understand it
third, you can try to compile some hello world like

int main() {return 0;}

with gcc - and post errors. Maybe you need to install gcc

greengrocer 07-05-2006 07:42 AM

Sorry, I still a bit of a noob. I wasnt sure where to find config.log and then I found it.

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.59. Invocation command line was

$ configure --with-cards=hda-intel --with-sequencer=yes --with-oss=yes

## --------- ##
## Platform. ##
## --------- ##

hostname = linuxbox
uname -m = i686
uname -r = 2.6.12-9-386
uname -s = Linux
uname -v = #1 Mon Oct 10 13:14:36 BST 2005

/usr/bin/uname -p = unknown
/bin/uname -X = unknown

/bin/arch = i686
/usr/bin/arch -k = unknown
/usr/convex/getsysinfo = unknown
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
PATH: /usr/bin/X11


## ----------- ##
## Core tests. ##
## ----------- ##

configure:1369: checking for gcc
configure:1395: result: gcc
configure:1639: checking for C compiler version
configure:1642: gcc --version </dev/null >&5
gcc (GCC) 4.0.2 20050808 (prerelease) (Ubuntu 4.0.1-4ubuntu9)
Copyright (C) 2005 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:1645: $? = 0
configure:1647: gcc -v </dev/null >&5
Using built-in specs.
Target: i486-linux-gnu
Configured with: ../src/configure -v --enable-languages=c,c++,java,f95,objc,ada,treelang --prefix=/usr --with-gxx-include-dir=/usr/include/c++/4.0.2 --enable-shared --with-system-zlib --libexecdir=/usr/lib --enable-nls --without-included-gettext --enable-threads=posix --program-suffix=-4.0 --enable-__cxa_atexit --enable-libstdcxx-allocator=mt --enable-clocale=gnu --enable-libstdcxx-debug --enable-java-gc=boehm --enable-java-awt=gtk --enable-gtk-cairo --with-java-home=/usr/lib/jvm/java-1.4.2-gcj-4.0-1.4.2.0/jre --enable-mpfr --disable-werror --enable-checking=release i486-linux-gnu
Thread model: posix
gcc version 4.0.2 20050808 (prerelease) (Ubuntu 4.0.1-4ubuntu9)
configure:1650: $? = 0
configure:1652: gcc -V </dev/null >&5
gcc: '-V' option must have argument
configure:1655: $? = 1
configure:1678: checking for C compiler default output file name
configure:1681: gcc conftest.c >&5
/usr/bin/ld: crt1.o: No such file: No such file or directory
collect2: ld returned 1 exit status
configure:1684: $? = 1
configure: failed program was:
| /* confdefs.h. */
|
| #define PACKAGE_NAME ""
| #define PACKAGE_TARNAME ""
| #define PACKAGE_VERSION ""
| #define PACKAGE_STRING ""
| #define PACKAGE_BUGREPORT ""
| /* end confdefs.h. */
|
| int
| main ()
| {
|
| ;
| return 0;
| }
configure:1723: error: C compiler cannot create executables
See `config.log' for more details.

## ---------------- ##
## Cache variables. ##
## ---------------- ##

ac_cv_env_CC_set=set
ac_cv_env_CC_value=gcc
ac_cv_env_CFLAGS_set=
ac_cv_env_CFLAGS_value=
ac_cv_env_CPPFLAGS_set=
ac_cv_env_CPPFLAGS_value=
ac_cv_env_CPP_set=
ac_cv_env_CPP_value=
ac_cv_env_LDFLAGS_set=
ac_cv_env_LDFLAGS_value=
ac_cv_env_build_alias_set=
ac_cv_env_build_alias_value=
ac_cv_env_host_alias_set=
ac_cv_env_host_alias_value=
ac_cv_env_target_alias_set=
ac_cv_env_target_alias_value=
ac_cv_prog_ac_ct_CC=gcc

## ----------------- ##
## Output variables. ##
## ----------------- ##

AR=''
ARCH=''
AS=''
CC='gcc'
CFLAGS=''
CONFIG_ALPHA=''
CONFIG_ARCH_PXA=''
CONFIG_ARCH_S3C2410=''
CONFIG_ARCH_SA1100=''
CONFIG_ARM=''
CONFIG_ARM_AMBA=''
CONFIG_BROKEN=''
CONFIG_EXPERIMENTAL=''
CONFIG_FW_LOADER=''
CONFIG_GSC=''
CONFIG_HAVE_PCSP_HOOK=''
CONFIG_HPET=''
CONFIG_I2C=''
CONFIG_I2C_SENSOR=''
CONFIG_INPUT=''
CONFIG_ISA=''
CONFIG_ISAPNP=''
CONFIG_ISAPNP_KERNEL=''
CONFIG_ISA_DMA_API=''
CONFIG_L3=''
CONFIG_MIPS=''
CONFIG_PARISC=''
CONFIG_PARPORT=''
CONFIG_PCI=''
CONFIG_PCMCIA=''
CONFIG_PNP=''
CONFIG_PNP_KERNEL=''
CONFIG_PPC=''
CONFIG_PPC_PMAC=''
CONFIG_PROC_FS=''
CONFIG_RTC=''
CONFIG_SBUS=''
CONFIG_SGI=''
CONFIG_SND=''
CONFIG_SND_AC97_BUS=''
CONFIG_SND_AC97_CODEC=''
CONFIG_SND_AD1816A=''
CONFIG_SND_AD1848=''
CONFIG_SND_AD1848_LIB=''
CONFIG_SND_AD1889=''
CONFIG_SND_ADLIB=''
CONFIG_SND_ALI5451=''
CONFIG_SND_ALS100=''
CONFIG_SND_ALS300=''
CONFIG_SND_ALS4000=''
CONFIG_SND_AOA=''
CONFIG_SND_AOA_FABRIC_LAYOUT=''
CONFIG_SND_AOA_ONYX=''
CONFIG_SND_AOA_SOUNDBUS=''
CONFIG_SND_AOA_SOUNDBUS_I2S=''
CONFIG_SND_AOA_TAS=''
CONFIG_SND_AOA_TOONIE=''
CONFIG_SND_ARMAACI=''
CONFIG_SND_ASIHPI=''
CONFIG_SND_ATIIXP=''
CONFIG_SND_ATIIXP_MODEM=''
CONFIG_SND_AU1X00=''
CONFIG_SND_AU8810=''
CONFIG_SND_AU8820=''
CONFIG_SND_AU8830=''
CONFIG_SND_AZT2320=''
CONFIG_SND_AZT3328=''
CONFIG_SND_BIT32_EMUL=''
CONFIG_SND_BT87X=''
CONFIG_SND_BT87X_OVERCLOCK=''
CONFIG_SND_CA0106=''
CONFIG_SND_CMI8330=''
CONFIG_SND_CMIPCI=''
CONFIG_SND_CS4231=''
CONFIG_SND_CS4231_LIB=''
CONFIG_SND_CS4232=''
CONFIG_SND_CS4236=''
CONFIG_SND_CS4281=''
CONFIG_SND_CS46XX=''
CONFIG_SND_CS46XX_NEW_DSP=''
CONFIG_SND_CS5535AUDIO=''
CONFIG_SND_DARLA20=''
CONFIG_SND_DARLA24=''
CONFIG_SND_DATE=''
CONFIG_SND_DEBUG=''
CONFIG_SND_DEBUG_DETECT=''
CONFIG_SND_DEBUG_MEMORY=''
CONFIG_SND_DT019X=''
CONFIG_SND_DUMMY=''
CONFIG_SND_DYNAMIC_MINORS=''
CONFIG_SND_ECHO3G=''
CONFIG_SND_EMU10K1=''
CONFIG_SND_EMU10K1X=''
CONFIG_SND_ENS1370=''
CONFIG_SND_ENS1371=''
CONFIG_SND_ES1688=''
CONFIG_SND_ES18XX=''
CONFIG_SND_ES1938=''
CONFIG_SND_ES1968=''
CONFIG_SND_ES968=''
CONFIG_SND_FM801=''
CONFIG_SND_FM801_TEA575X=''
CONFIG_SND_GINA20=''
CONFIG_SND_GINA24=''
CONFIG_SND_GUSCLASSIC=''
CONFIG_SND_GUSEXTREME=''
CONFIG_SND_GUSMAX=''
CONFIG_SND_GUS_SYNTH=''
CONFIG_SND_HARMONY=''
CONFIG_SND_HDA_INTEL=''
CONFIG_SND_HDSP=''
CONFIG_SND_HDSPM=''
CONFIG_SND_HPET=''
CONFIG_SND_HWDEP=''
CONFIG_SND_ICE1712=''
CONFIG_SND_ICE1724=''
CONFIG_SND_INDIGO=''
CONFIG_SND_INDIGODJ=''
CONFIG_SND_INDIGOIO=''
CONFIG_SND_INTEL8X0=''
CONFIG_SND_INTEL8X0M=''
CONFIG_SND_INTERWAVE=''
CONFIG_SND_INTERWAVE_STB=''
CONFIG_SND_KERNELDIR=''
CONFIG_SND_KORG1212=''
CONFIG_SND_LAYLA20=''
CONFIG_SND_LAYLA24=''
CONFIG_SND_LOOPBACK=''
CONFIG_SND_MAESTRO3=''
CONFIG_SND_MIA=''
CONFIG_SND_MIRO=''
CONFIG_SND_MIXART=''
CONFIG_SND_MIXER_OSS=''
CONFIG_SND_MONA=''
CONFIG_SND_MPU401=''
CONFIG_SND_MPU401_UART=''
CONFIG_SND_MSND_PINNACLE=''
CONFIG_SND_MTPAV=''
CONFIG_SND_MTS64=''
CONFIG_SND_MVERSION=''
CONFIG_SND_NM256=''
CONFIG_SND_OPL3SA2=''
CONFIG_SND_OPL3_LIB=''
CONFIG_SND_OPL4_LIB=''
CONFIG_SND_OPTI92X_AD1848=''
CONFIG_SND_OPTI92X_CS4231=''
CONFIG_SND_OPTI93X=''
CONFIG_SND_OSSEMUL=''
CONFIG_SND_PC98_CS4232=''
CONFIG_SND_PCM=''
CONFIG_SND_PCM_OSS=''
CONFIG_SND_PCM_OSS_PLUGINS=''
CONFIG_SND_PCM_XRUN_DEBUG=''
CONFIG_SND_PCSP=''
CONFIG_SND_PCXHR=''
CONFIG_SND_PDAUDIOCF=''
CONFIG_SND_PDPLUS=''
CONFIG_SND_PORTMAN2X4=''
CONFIG_SND_POWERMAC=''
CONFIG_SND_POWERMAC_AUTO_DRC=''
CONFIG_SND_PXA2XX_AC97=''
CONFIG_SND_PXA2XX_I2SOUND=''
CONFIG_SND_PXA2XX_PCM=''
CONFIG_SND_RAWMIDI=''
CONFIG_SND_RIPTIDE=''
CONFIG_SND_RME32=''
CONFIG_SND_RME9652=''
CONFIG_SND_RME96=''
CONFIG_SND_RTCTIMER=''
CONFIG_SND_S3C2410=''
CONFIG_SND_SA11XX_UDA1341=''
CONFIG_SND_SB16=''
CONFIG_SND_SB16_CSP=''
CONFIG_SND_SB8=''
CONFIG_SND_SBAWE=''
CONFIG_SND_SEQUENCER=''
CONFIG_SND_SEQUENCER_OSS=''
CONFIG_SND_SEQ_DUMMY=''
CONFIG_SND_SEQ_RTCTIMER_DEFAULT=''
CONFIG_SND_SERIALMIDI=''
CONFIG_SND_SERIAL_U16550=''
CONFIG_SND_SGALAXY=''
CONFIG_SND_SONICVIBES=''
CONFIG_SND_SSCAPE=''
CONFIG_SND_SUN_AMD7930=''
CONFIG_SND_SUN_CS4231=''
CONFIG_SND_SUN_DBRI=''
CONFIG_SND_SUPPORT_OLD_API=''
CONFIG_SND_TIMER=''
CONFIG_SND_TRIDENT=''
CONFIG_SND_USB_AUDIO=''
CONFIG_SND_USB_USX2Y=''
CONFIG_SND_VERBOSE_PRINTK=''
CONFIG_SND_VERBOSE_PROCFS=''
CONFIG_SND_VERSION='1.0.12rc1'
CONFIG_SND_VIA82XX=''
CONFIG_SND_VIA82XX_MODEM=''
CONFIG_SND_VIRMIDI=''
CONFIG_SND_VX222=''
CONFIG_SND_VXPOCKET=''
CONFIG_SND_VX_LIB=''
CONFIG_SND_WAVEFRONT=''
CONFIG_SND_YMFPCI=''
CONFIG_SOC_AU1000=''
CONFIG_SOC_AU1100=''
CONFIG_SOC_AU1500=''
CONFIG_SOUND=''
CONFIG_SOUND_PRIME=''
CONFIG_SPARC32=''
CONFIG_SPARC64=''
CONFIG_SPARC=''
CONFIG_USB=''
CONFIG_VIDEO_DEV=''
CONFIG_X86=''
CONFIG_X86_64=''
CONFIG_X86_PC9800=''
CPP=''
CPPFLAGS=''
CROSS_COMPILE=''
DEFS=''
ECHO_C=''
ECHO_N='-n'
ECHO_T=''
EGREP=''
EXEEXT=''
EXTRA_INCLUDES=''
GENKSYMS=''
INSTALL_DATA=''
INSTALL_PROGRAM=''
INSTALL_SCRIPT=''
KERNEL_INC=''
KLD=''
LDFLAGS=''
LIBOBJS=''
LIBS=''
LTLIBOBJS=''
MAKE_ADDS=''
NEW_KBUILD=''
OBJEXT=''
PACKAGE_BUGREPORT=''
PACKAGE_NAME=''
PACKAGE_STRING=''
PACKAGE_TARNAME=''
PACKAGE_VERSION=''
PATH_SEPARATOR=':'
RANLIB=''
SHELL='/bin/sh'
SRCDIR=''
ac_ct_CC='gcc'
ac_ct_RANLIB=''
bindir='${exec_prefix}/bin'
build_alias=''
c_opts=''
datadir='${prefix}/share'
exec_prefix='NONE'
host_alias=''
includedir='${prefix}/include'
infodir='${prefix}/info'
kaversion=''
kextraversion=''
kpatchlevel=''
ksublevel=''
kversion=''
libdir='${exec_prefix}/lib'
libexecdir='${exec_prefix}/libexec'
localstatedir='${prefix}/var'
m_opts=''
mandir='${prefix}/man'
moddir=''
moddir_tree=''
modsubdir=''
msmp=''
oldincludedir='/usr/include'
prefix='NONE'
processor=''
program_transform_name='s,x,x,'
sbindir='${exec_prefix}/sbin'
sharedstatedir='${prefix}/com'
sysconfdir='${prefix}/etc'
target_alias=''

## ----------- ##
## confdefs.h. ##
## ----------- ##

#define PACKAGE_BUGREPORT ""
#define PACKAGE_NAME ""
#define PACKAGE_STRING ""
#define PACKAGE_TARNAME ""
#define PACKAGE_VERSION ""

configure: exit 77


It say it cant find a file ctrl.o. Why wouldnmt I have that file?

raskin 07-06-2006 01:10 AM

Well, crt1.o is a necessary part of binary created by gcc (it is low level start-up code no one would want to write in each program). Maybe you have broken gcc or binutils installation. Do you have /usr/lib/crt1.o ? If not, try reinstalling gcc, I guess.

greengrocer 07-06-2006 05:09 AM

Thanks raskin, your post placed a little more light as to the problem.

Strange, Ubuntu doesn't include everything you need to compile C programs it would seem so...

I did an 'apt-get install build-essentials'

which seems to have got me to the next problem. I get the following error in my config.log:

hostname = linuxbox
uname -m = i686
uname -r = 2.6.12-9-386
uname -s = Linux
uname -v = #1 Mon Oct 10 13:14:36 BST 2005

/usr/bin/uname -p = unknown
/bin/uname -X = unknown

/bin/arch = i686
/usr/bin/arch -k = unknown
/usr/convex/getsysinfo = unknown
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
PATH: /usr/bin/X11


## ----------- ##
## Core tests. ##
## ----------- ##

configure:1369: checking for gcc
configure:1395: result: /usr/bin/gcc
configure:1639: checking for C compiler version
configure:1642: /usr/bin/gcc --version </dev/null >&5
gcc (GCC) 4.0.2 20050808 (prerelease) (Ubuntu 4.0.1-4ubuntu9)
Copyright (C) 2005 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:1645: $? = 0
configure:1647: /usr/bin/gcc -v </dev/null >&5
Using built-in specs.
Target: i486-linux-gnu
Configured with: ../src/configure -v --enable-languages=c,c++,java,f95,objc,ada,treelang --prefix=/usr --with-gxx-include-dir=/usr/include/c++/4.0.2 --enable-shared --with-system-zlib --libexecdir=/usr/lib --enable-nls --without-included-gettext --enable-threads=posix --program-suffix=-4.0 --enable-__cxa_atexit --enable-libstdcxx-allocator=mt --enable-clocale=gnu --enable-libstdcxx-debug --enable-java-gc=boehm --enable-java-awt=gtk --enable-gtk-cairo --with-java-home=/usr/lib/jvm/java-1.4.2-gcj-4.0-1.4.2.0/jre --enable-mpfr --disable-werror --enable-checking=release i486-linux-gnu
Thread model: posix
gcc version 4.0.2 20050808 (prerelease) (Ubuntu 4.0.1-4ubuntu9)
configure:1650: $? = 0
configure:1652: /usr/bin/gcc -V </dev/null >&5
gcc: '-V' option must have argument
configure:1655: $? = 1
configure:1678: checking for C compiler default output file name
configure:1681: /usr/bin/gcc conftest.c >&5
configure:1684: $? = 0
configure:1730: result: a.out
configure:1735: checking whether the C compiler works
configure:1741: ./a.out
configure: line 1742: ./a.out: Permission denied
configure:1744: $? = 126
configure:1753: error: cannot run C compiled programs.
If you meant to cross compile, use `--host'.
See `config.log' for more details.

## ---------------- ##
## Cache variables. ##
## ---------------- ##

ac_cv_env_CC_set=set
ac_cv_env_CC_value=/usr/bin/gcc
ac_cv_env_CFLAGS_set=
ac_cv_env_CFLAGS_value=
ac_cv_env_CPPFLAGS_set=
ac_cv_env_CPPFLAGS_value=
ac_cv_env_CPP_set=
ac_cv_env_CPP_value=
ac_cv_env_LDFLAGS_set=
ac_cv_env_LDFLAGS_value=
ac_cv_env_build_alias_set=
ac_cv_env_build_alias_value=
ac_cv_env_host_alias_set=
ac_cv_env_host_alias_value=
ac_cv_env_target_alias_set=
ac_cv_env_target_alias_value=
ac_cv_exeext=
ac_cv_prog_ac_ct_CC=/usr/bin/gcc


It looks like it is trying to run a.out using the command ./a.out

Which is interesting because i have noticed that I cannot ./<foo> I have to use sh <foo> instead.

Why would this be? can this be overcome by editing my etc/passwd file?

raskin 07-06-2006 05:20 AM

1. Ubuntu is not meant as a distribution optimal for anyone with a wish to understand what's going on - or compile something. It is meant to spread Linux and GNU OS for users.

2. To be able to run something with ./<name>, it must have enabled execution bit. man chmod, man ls.

3. If gcc produces executables with execution bit unset, it is installed incorrectly (to be more exact, binutils are). Unfortunately I don't know how to fix debian-based Ubuntu... And what happens when you chmod a+x a.out and run it by ./a.out? (theoretically can be dangerous.. in case of having valuable data in your user dir recommended to do - of course - by user, and even not the one you are ordinarily logged in as) What says 'echo $?' after it?


All times are GMT -5. The time now is 12:54 AM.