Re: g77 problem with -lstdc++

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, Apr 27, 2008 at 07:21:43PM +0100, Paul Smith wrote:
> I am experiencing the following problem with g77
> 
> $ g77 -O4 -lstdc++ cwrapper.o toyprob.o algencanma.o algencan.o -o algencanma
> /usr/bin/ld: cannot find -lstdc++
> collect2: ld returned 1 exit status
> $
> 
> Any ideas?

I've just skimmed the thread, so sorry if this has been already answered.

First of all, have you tried compiling/linking using gfortran instead?
It supports not just Fortran95 and later, but also Fortran77.  g77 is just a
Fortran77 compatibility compiler, in case you have code that uses the very
few g77 intrinsics that aren't supported by gfortran yet (this got even
better again in GCC 4.3).

Second, I saw the you have *.f and *.c sources, are you sure the latter
are C++ and not plain C (then you should just compile them using a C
compiler and don't need C++ compiler)?

If the answer for both of the above is that you really have to use g77 and
the sources are in C++, then make sure you have also compat-gcc-34-c++
package installed and compile the C++ sources using g++34, F77 sources
using g77 as you did and finally just link with g77.
If compat-gcc-34-c++ is installed, then g77 will be able to find the GCC 3.4
compatibility libstdc++.  Also, you should learn to put -lstdc++ and other
-l* options last on the command line, not first - while the above works for
shared libstdc++, it wouldn't work for static link.

	Jakub

-- 
fedora-list mailing list
fedora-list@xxxxxxxxxx
To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
[Index of Archives]     [Older Fedora Users]     [Fedora Announce]     [Fedora Package Announce]     [EPEL Announce]     [Fedora Magazine]     [Fedora News]     [Fedora Summer Coding]     [Fedora Laptop]     [Fedora Cloud]     [Fedora Advisory Board]     [Fedora Education]     [Fedora Security]     [Fedora Scitech]     [Fedora Robotics]     [Fedora Maintainers]     [Fedora Infrastructure]     [Fedora Websites]     [Anaconda Devel]     [Fedora Devel Java]     [Fedora Legacy]     [Fedora Desktop]     [Fedora Fonts]     [ATA RAID]     [Fedora Marketing]     [Fedora Management Tools]     [Fedora Mentors]     [SSH]     [Fedora Package Review]     [Fedora R Devel]     [Fedora PHP Devel]     [Kickstart]     [Fedora Music]     [Fedora Packaging]     [Centos]     [Fedora SELinux]     [Fedora Legal]     [Fedora Kernel]     [Fedora OCaml]     [Coolkey]     [Virtualization Tools]     [ET Management Tools]     [Yum Users]     [Tux]     [Yosemite News]     [Gnome Users]     [KDE Users]     [Fedora Art]     [Fedora Docs]     [Asterisk PBX]     [Fedora Sparc]     [Fedora Universal Network Connector]     [Libvirt Users]     [Fedora ARM]

  Powered by Linux