473,395 Members | 1,502 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Clearing/resetting g++/ld linker path for each -l

Hi,

This is really a g++/gcc/ld issue rather than C++ specifically -
please redirect me to another newsgroup if there's a more appropriate
place to ask! Also, I thought I'd posted this topic yesterday but on
looking I can't find it. Either something went wrong with the my
system or I just forgot to press "Submit"... sorry if this question
does end up appearing twice.

My problem is that if I have two libraries A and B, and there's a
version of each in two include paths, say /usr/lib and /usr/local/lib.
So we've got /usr/lib/libA.so, /usr/lib/libB.so, /usr/local/lib/
libA.so and /usr/local/lib/libB.so. Now I want to link against the
version of library A from /usr/lib and the version of B from /usr/
local/lib. Unfortunately this command line doesn't work:

g++ ... -L/usr/lib -lA -L/usr/local/lib -lB

because /usr/lib is still the first location in the library search
path when -lB gets interpreted. In the general case I won't know so
much about the exact library paths, so let's assume for now that I
can't just use absolute paths to each library. Is there maybe a way
that I can reset or clear the library search path in between each -l,
e.g.

g++ ... -L/usr/lib -lA -reset-libpath -L/usr/local/lib -lB

? I'm using autotools and libtool if that's any help. If there's no
way of doing that, is there any other technique which will avoid me
needing to rewrite a large chunk of our build system's m4 macros to
work out absolute paths for every library?

Thanks!
Andy

May 17 '07 #1
1 3057
Andy Buckley wrote:
Hi,

This is really a g++/gcc/ld issue rather than C++ specifically -
please redirect me to another newsgroup if there's a more appropriate
place to ask! [..]
Here you go: gnu.g++.help.

V
--
Please remove capital 'A's when replying by e-mail
I do not respond to top-posted replies, please don't ask
May 17 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: TGF | last post by:
Hello, I am creating a console app. I try to link a static library by including it in the Linker-Input-Additional Dependencies field under the Project properties. Then I specify the path to...
0
by: Thomas Meier | last post by:
Hi, i have a problem with Visual Studio .Net 2003. in VS 5.0 it was possible to change the Compiler and Linker with 2 settings in the windows registry: ...
4
by: news.eircom.net | last post by:
Hello, How do you clear the contents of an ostringstream object? I've included some example code so you can see what I mean. t.i.a. Craig H. #include <iostream>
1
by: Laszlo | last post by:
Hi all, As a novice I installed PostgreSQL 7.2.1 on Win32 and works, Borland C++Builder Enterprise Suite 5.0 (build 12.34) what works too. I decided to combine these two programs and develop a...
15
by: tmax | last post by:
PHP Pros: I have a simple html form that submits data to a php script, which processes it, and then redisplays the same page, but with a "thank you" message in place of the html form. This is...
1
by: amber | last post by:
Hello, What is the best method of clearing a datagrid? I'm having issues with it not 'resetting' when I want to repopulate it. I usually design my datagrids using the .net toolbar/properties, but...
3
by: DrOrbit | last post by:
I'm trying to configure Visual Studio 2005 (C#) to produce a MEX DLL that will interface with MatLab. I found an online source that describes some files that I need to attach to the DLL. The...
1
by: Felix | last post by:
After porting a project from VC6 to VC.NET 2003 I have a very strange problem generating link error 1104 for import libraries. I just ported the project and made some small adaptions so it fits...
4
by: yOtA | last post by:
I get this Linker Errors while compiling my program: Error: Unresolved external 'vminit()' referenced from C:\TESTE\TESTE.OBJ Error: Unresolved external 'vmalloc(void *, int, unsigned int,...
1
by: Andy Buckley | last post by:
Hi, I'd like to know if it's possible to clear the ld library search path within a single linker call. Specificlly, the problem is that I have two libraries A and B, and there's a version of...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.