help-gplusplus
[Top][All Lists]
Advanced

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

Re: library problem - my own version of C++ using gcc does not link


From: Paul Pluzhnikov
Subject: Re: library problem - my own version of C++ using gcc does not link
Date: Tue, 22 May 2007 17:42:04 -0700
User-agent: Gnus/5.1006 (Gnus v5.10.6) XEmacs/21.4 (Jumbo Shrimp, linux)

Jim Anderson <ezjab@ieee.org> writes:

> I tried compiling a C++ program that I have. All of the
> C++ files compile ok, but during the linking phase,
> I get numerous error messages. The first of which is:
>
>  >>> test.o: In function
>  >>> 
> `__static_initialization_and_destruction_0':/usr/local/lib/gcc/i686-pc-linux-gnu/4.1.2/../../../../include/c++/4.1.2/iostream:76:
>  >>> undefined reference to `std::ios_base::Init::Init()'

The first question is: what's your failing link line?
Always use correct compiler driver (g++ for C++ code) when compiling
and linking. IOW, do not do this:

  gcc main.cpp

do this instead:

  g++ main.cpp

> It looks to me like the libraries are not being found right.

Possible, but less likely than the "user mistake" above.

Cheers,
-- 
In order to understand recursion you must first understand recursion.
Remove /-nsp/ for email.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]