Solved

Library Issue

Posted on 2006-10-19
1
145 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

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Introduction This article is the first in a series of articles about the C/C++ Visual Studio Express debugger.  It provides a quick start guide in using the debugger. Part 2 focuses on additional topics in breakpoints.  Lastly, Part 3 focuses on th…
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
The goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.

706 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

15 Experts available now in Live!

Get 1:1 Help Now