Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

When I run the ./configure command in ffmpeg source directory I get this error:

gcc is unable to create an executable file. If gcc is a cross-compiler, use the --enable-cross-compile option. Only do this if you know what cross compiling means. C compiler test failed.

If you think configure made a mistake, make sure you are using the latest version from Git.  If the latest version fails, report the problem to the ffmpeg-user@ffmpeg.org mailing list or IRC #ffmpeg on irc.freenode.net. Include the log file "config.log" produced by configure as this will help solving the problem.

in config.log:

check_ld cc
check_cc
BEGIN /tmp/ffconf.xECiIX7z.c
    1   int main(void){ return 0; }
END /tmp/ffconf.xECiIX7z.c
gcc -c -o /tmp/ffconf.xsCaoMWN.o /tmp/ffconf.xECiIX7z.c
gcc -o /tmp/ffconf.ApzYq7NQ /tmp/ffconf.xsCaoMWN.o
/usr/lib/gcc/x86_64-linux-gnu/4.6.1/../../../x86_64-linux-gnu/crt1.o: In function `_start':
(.text+0x12): undefined reference to `__libc_csu_fini'
/usr/lib/gcc/x86_64-linux-gnu/4.6.1/../../../x86_64-linux-gnu/crt1.o: In function `_start':
(.text+0x19): undefined reference to `__libc_csu_init'
collect2: ld returned 1 exit status
C compiler test failed.

What's wrong? What should I do?

share|improve this question
    
Take a hint from "include the config.log". –  Stéphane Chazelas Sep 3 '12 at 20:09
    
Please see the edited post –  Omid Sep 3 '12 at 20:21
    
What operating system is this? Is this the GCC that came with the OS? Are you running a 32-bit or 64-bit version of the OS? Did you pass any arguments to ./configure? –  Gilles Sep 3 '12 at 23:12
    
how do you make? did you ./configure ? if true What's your distro? uname -a –  Mohsen Pahlevanzadeh Sep 3 '12 at 23:18
    
@Gilles: Ubuntu 64-bit. I don't pass any arguments to ./configure –  Omid Sep 4 '12 at 8:08
add comment

2 Answers 2

up vote 2 down vote accepted
+50

Your libc installation is incomplete or broken somehow. You should say what OS you use... the easiest fix is probably to reinstall the packages that comprise the libc.

Or if you are really interested in finding out exactly which part of it is broken, here are some tips:

On a typical glibc installation, the references to __libc_csu_init and __libc_csu_fini will be resolved by finding them in /usr/lib/libc_nonshared.a which you can check as follows:

$ nm /usr/lib/libc_nonshared.a | egrep '__libc_csu_(init|fini)'
0000000000000000 T __libc_csu_fini
0000000000000010 T __libc_csu_init

The use of /usr/lib/libc_nonshared.a will be triggered by linking to /usr/lib/libc.so (which is a text file, not an actual shared object). You can check that like this:

There may be some other stuff in it too. You can check that with

$ less /usr/lib/libc.so
[...]
GROUP ( /lib/libc.so.6 /usr/lib/libc_nonshared.a )

/usr/lib/libc.so will be used by the linker to satisfy the -lc requirement, which you can check like this:

$ ld --verbose -lc
[... lots of stuff ...]
opened script file /usr/lib64/libc.so
attempt to open /lib/libc.so.6 succeeded
/lib/libc.so.6
attempt to open /usr/lib/libc_nonshared.a succeeded
share|improve this answer
    
How do I reinstall glibc? apt-get install(remove) glibc says there is no package named glibc –  Omid Sep 4 '12 at 8:13
    
apt-get install --reinstall libc6 –  Alan Curry Sep 5 '12 at 20:20
    
Thanks Alan, it works –  Omid Sep 5 '12 at 20:44
add comment

That means you don't have the necessary software to compile C code.

Run this:

apt-get install build-essential

You also want the build dependencies for ffmpeg:

apt-get build-dep ffmpeg

Then try again.

share|improve this answer
    
Unfortunately still getting the same error –  Omid Sep 4 '12 at 10:49
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.