ld: cannot find -lgcc after upgrade to Ubuntu 10.04 ... lazarus / 1-Linux ---------------------------------------------------------------------- mionut · 2010-08-11 19:14 Hi all! After upgrading the distribution to Ubuntu 10.04 Compiling my old projects stopped compiling/linking with the message "/usr/bin/ld: cannot find -lgcc". Since downgrading the distribution is somehow problematic, I'm asking desperately the lazarus community for help. Did anyone else encountered this problem? [edit] There is another message that previously did not came up at compiling/linking: "/usr/bin/ld: warning: /home/ionut/src/voice/eadtst/link.res contains output sections; did you forget -T?" Please help ... Thank you. ---------------------------------------------------------------------- Troodon · 2010-08-11 20:15 I wouldn't worry about the second one. As for the (first) linking error, what Lazarus + FPC version do you run on your Ubuntu 10.04 machine? Also, try reinstalling gcc in Synaptic. ---------------------------------------------------------------------- mionut · 2010-08-11 20:23 Lazarus version: 0.9.28.2-8ubuntu1 beta FPC version: Free Pascal Compiler version 2.4.0-2 [2010/03/06] for i386 Reinstalled gcc with synaptic. Same annoying message "ld: cannot find -lgcc". Thank you for the response. ---------------------------------------------------------------------- mica · 2010-08-11 20:43 32/64 bit Problem? 32 bit FPC with 64 bit OS? ---------------------------------------------------------------------- mionut · 2010-08-11 20:49 If my previous distribution was 32 bit is it possible that the upgraded one is 64 bit? Anyway, I've read about this on some other forums, did install gcc-multilib ... but no joy. gcc -v gives the following: Using built-in specs. Target: i486-linux-gnu Configured with: ../src/configure -v --with-pkgversion='Ubuntu 4.4.3-4ubuntu5' --with- bugurl=file:///usr/share/doc/gcc-4.4/README.Bugs --enable- languages=c,c++,fortran,objc,obj-c++ --prefix=/usr --enable-shared --enable-multiarch --enable-linker-build-id --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --enable- threads=posix --with-gxx-include-dir=/usr/include/c++/4.4 --program- suffix=-4.4 --enable-nls --enable-clocale=gnu --enable-libstdcxx-debug --enable-plugin --enable-objc-gc --enable-targets=all --disable-werror --with-arch-32=i486 --with-tune=generic --enable-checking=release --build=i486-linux-gnu --host=i486-linux-gnu --target=i486-linux-gnu Thread model: posix gcc version 4.4.3 (Ubuntu 4.4.3-4ubuntu5) So i think it's a 32 bit distro... ---------------------------------------------------------------------- Marc · 2010-08-11 21:12 Quote from: mionut on August 11, 2010, 10:23:30 pmLazarus version: 0.9.28.2-8ubuntu1 beta FPC version: Free Pascal Compiler version 2.4.0-2 [2010/03/06] for i386 Reinstalled gcc with synaptic. Same annoying message "ld: cannot find -lgcc". Thank you for the response. Did you install the libgcc-devel package ? ---------------------------------------------------------------------- mionut · 2010-08-11 21:21 apt-cache search libgcc gives nothing containing dev or devel ... #apt-cache search libgcc libgcc1 - GCC support library libgcc1-dbg - GCC support library (debug symbols) What package are you refering# dpkg -l | grep gcc output: ii  gcc                                        4:4.4.3-1ubuntu1                                         The GNU C compiler ii  gcc-4.3                                    4.3.4-10ubuntu1                                          The GNU C compiler ii  gcc-4.3-base                               4.3.4-10ubuntu1                                          The GNU Compiler Collection (base package) ii  gcc-4.4                                    4.4.3-4ubuntu5                                           The GNU C compiler ii  gcc-4.4-base                               4.4.3-4ubuntu5                                           The GNU Compiler Collection (base package) ii  gcc-4.4-multilib                           4.4.3-4ubuntu5                                           The GNU C compiler (multilib files) ii  gcc-multilib                               4:4.4.3-1ubuntu1                                         The GNU C compiler (multilib files) ii  gccxml                                     0.9.0+cvs20090916-1                                      XML output extension to GCC ii  lib64gcc1                                  1:4.4.3-4ubuntu5                                         GCC support library (64bit) ii  libgcc1                                    1:4.4.3-4ubuntu5                                         GCC support library ---------------------------------------------------------------------- Troodon · 2010-08-11 23:37 If you installed the Lazarus metapackage then it should have also installed all the required dependencies. When I upgraded from 9.10 to 10.04 it went smoothly. I would uninstall and reinstall Lazarus. ---------------------------------------------------------------------- mionut · 2010-08-12 09:35 Hi, I've reinstalled lazarus metapackage. Same error. Some more info. In my project i use a unit (fftw_s for fast fourier transforms by Daniel Mantione) that has a directive {$LINKLIB gcc} somewhere in the source. This should be a required library for libfftw3. If i comment out this directive, project builds and links ok. Will test if this will have some negative impact on the project. ---------------------------------------------------------------------- felipemdc · 2010-08-12 10:55 Quote from: mionut on August 11, 2010, 11:21:32 pmii  lib64gcc1                                1:4.4.3-4ubuntu5                                         GCC support library (64bit) ii  libgcc1                                    1:4.4.3-4ubuntu5                                         GCC support library Probably these ones. ---------------------------------------------------------------------- Troodon · 2010-08-12 11:35 OK, so your project (not Lazarus/FPC) needs library libgcc.so (or a symlink with that name) and cannot find it in the PATH. My best guess is that you need file /lib/libgcc_s.so.1 in package libgcc1. Try creating a symlink to it (as superuser: ln -s /lib/libgcc_s.so.1 /lib/libgcc.so) then reboot and build your project again. If it still doesn't work for you then delete the symlink (as superuser: rm /lib/libgcc.so) to avoid potential file conflicts in the future.