This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Question
- To: "Sampson, Michael J." <sampsomj at pweh dot com>
- Subject: Re: Question
- From: Bo Thorsen <bo at sonofthor dot dk>
- Date: Thu, 5 Oct 2000 17:27:44 +0200 (MET DST)
- Cc: "'gcc at gcc dot gnu dot org'" <gcc at gcc dot gnu dot org>
On Thu, 5 Oct 2000, Sampson, Michael J. wrote:
> Hello,
> Currently I am working on a project that consists of Fortran, C, C++
> and a front end which is written in C++. I am having trouble with linking
> all of my object files I have built. I've spent some time reading through
> the GNU GCC and G77 manuals on your web site. Right now I seemed to be stuck
> where I'm trying to do the final linking stage with gcc. No matter how I
> arrange the linking part I am getting undefined symbol references. If I try
> to do the linking with g++, I get Fortran undefined reference symbols, if I
> try to the linking with g77, I get C++ undefined references (iostream).
> Could the GNU GCC group perhaps guide in a direction to resolve this issue?
When you use gcc to link c++ programs, you have to include the libstdc++
yourself -- this is one of the differences between gcc and g++. Simply add
the -lstdc++ flag to LFLAGS, and you should be rid of the iostream
problems.
Bo.
--
Bo Thorsen
bo@sonofthor.dk
Lahnsgade 31, st.
DK-5000 Odense C
Tlf: +45 66 11 83 85
Rule one of good programmers: anything You can do, I can do better
Rule two of good programmers: anything I can do, You can do better
The Programming Theorem: anything worth doing is worth doing over and over again