?
Solved

Library Issue

Posted on 2006-10-19
1
Medium Priority
?
151 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 17

Accepted Solution

by:
rstaveley earned 2000 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

[Webinar] How Hackers Steal Your Credentials

Do You Know How Hackers Steal Your Credentials? Join us and Skyport Systems to learn how hackers steal your credentials and why Active Directory must be secure to stop them.

Question has a verified solution.

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

Errors will happen. It is a fact of life for the programmer. How and when errors are detected have a great impact on quality and cost of a product. It is better to detect errors at compile time, when possible and practical. Errors that make their wa…
This article shows you how to optimize memory allocations in C++ using placement new. Applicable especially to usecases dealing with creation of large number of objects. A brief on problem: Lets take example problem for simplicity: - I have a G…
The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.
Suggested Courses

764 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