Solved

Library Issue

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

[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. Thursday, July 13, 2017 10:00 A.M. PDT

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…
Many modern programming languages support the concept of a property -- a class member that combines characteristics of both a data member and a method.  These are sometimes called "smart fields" because you can add logic that is applied automaticall…
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.
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.

695 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