I'm trying to use gcc-3.4
on the latest Ubuntu. The package is from debian snapshots.
It probably assumes different default directory structure, so for example I was forced to give it -I /usr/include/i386-linux-gnu/
, which gcc-4
assumed implicitly.
Currently it compiles everything I gave it just fine, but it can't link. Even the simplest executable results the error:
$ gcc-3.4 ~/tmp.cc -o ~/tmp
/usr/bin/ld: cannot find -lgcc_s
collect2: ld returned 1 exit status
Apparently you need to add the library
/lib/i386-linux-gnu/libgcc_s.so.1
and the compiler expect the soft link/usr/lib/gcc/i486-linux-gnu/3.4.6/libgcc_s.so
pointing it to the correct place, however:And
Fix the symlink, and all will be well
Now it works correctly!
I had a similar problem, but in my case trying to install gcc 4.2 (to compile in Matlab Simulink) in Ubuntu 11.04
In my case I wrote:
And now gcc-4.2 is compiling.
for me the command:
does not solve the issue.
This command, instead, does solve it: