Solved

Library Issue

Posted on 2006-10-19
1
146 Views
Last Modified: 2010-04-01
I am compiling an application with gcc 3.3.5 (built from its sources) and in the middle of the compilation, the source refers to "basic_string.h" header, and the linker wants to look into the /usr/include/c++/4.1.2/bits/ folder for the real function to link, but the source invokes a wrong overload of the function.
 
Why is gcc 3.3.5 is looking for the library into the wrong path?

I guess I am having more than one version of the same library (libstdc++), and consequently, more than one way to get the library to link from.

How can we change this behavior? I need to build the application with gcc 3.3.5 built from its source (there was no Debian package for gcc-3.3.5), and I need to know how to link from the correct library.

The compiler is finding the header into /usr/lib/gcc/i486-linux-gnu/4.1.2/../../../../include/c++/4.1.2/bits/
It seems to go from /usr/lib/gcc/i486-linux-gnu/4.1.2 to /usr//usr/lib/gcc/i486-linux-gnu/4.1.2?
0
Comment
Question by:superfly18
1 Comment
 
LVL 17

Accepted Solution

by:
rstaveley earned 500 total points
ID: 17800326
It looks like you've still got headers from 4.1.2 in your include path.

Can I suggest that you build gcc-3.3.5 again, but this time pass (say) the parameter...

    --prefix=/home/superfly18/gcc-3.3.5                       <- Or whatever your home dir is

...to the ./configure script. That will put your installation into a separate place which doesn't get entangled with your Debian defaults. When you then make your application, you can set up your path to prefer the binaries in this directory, and this directory should be set up with everything gcc-3.3.5-ish and not at all 4.1.2-ish.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

  Included as part of the C++ Standard Template Library (STL) is a collection of generic containers. Each of these containers serves a different purpose and has different pros and cons. It is often difficult to decide which container to use and …
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.

867 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now