473,395 Members | 1,403 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.

Problem linking static libs with common dependencies

MS VC++ 7.1 - I have a project with static libs A, B and C where A depends on
B anc C, also B depends on C. If I set this up in the project dependency
dialog for A the Build environment puts B and C in the command line (seen
in the Librarian view of the project settings for A) an as a result I get
LNK4006 warnings all over the place.

So I am trying to establish dependencies such that A gets rebuilt if source
in B or C changes. What I am getting is that PLUS the linker is trying to
link the other static libs into A which it should not be doing.

This has got to be a bug right?

Nov 17 '05 #1
3 1466
"Eric W" <Er***@discussions.microsoft.com> wrote in message
news:44**********************************@microsof t.com...
MS VC++ 7.1 - I have a project with static libs A, B and C where A depends
on
B anc C, also B depends on C. If I set this up in the project dependency
dialog for A the Build environment puts B and C in the command line
(seen
in the Librarian view of the project settings for A) an as a result I get
LNK4006 warnings all over the place.

So I am trying to establish dependencies such that A gets rebuilt if
source
in B or C changes. What I am getting is that PLUS the linker is trying to
link the other static libs into A which it should not be doing.

This has got to be a bug right?


That does sound iffy.

On the other hand, building the way the IDE wants to, you only need to link
executables with library A, which some might see as a "feature".

-cd
Nov 17 '05 #2
Eric W wrote:
MS VC++ 7.1 - I have a project with static libs A, B and C where A depends on
B anc C, also B depends on C. If I set this up in the project dependency
dialog for A the Build environment puts B and C in the command line (seen
in the Librarian view of the project settings for A) an as a result I get
LNK4006 warnings all over the place.

So I am trying to establish dependencies such that A gets rebuilt if source
in B or C changes. What I am getting is that PLUS the linker is trying to
link the other static libs into A which it should not be doing.

This has got to be a bug right?


If you set a dll or lib as a dependant project in VC, the IDE
automagically tries to link its lib or export library to the dependee.
This can incredibly annoying for plug-in style DLL projects with
abstract DLL interfaces (but you wish to enforce a build order).
Luckily after many many many months of being annoyed at MS for this
behavior, I discovered it could be turned off with a rather esoteric
project setting.

For the dependant project, under the project properties

set 'Linker->Ignore Import Library' to 'Yes' and it will not cause other
projects which depend on it to link the import library generated by it.
And all will be sane and right in your universe.
Nov 17 '05 #3


"Sean Cavanaugh" wrote:
Eric W wrote:
MS VC++ 7.1 - I have a project with static libs A, B and C where A depends on
B anc C, also B depends on C. If I set this up in the project dependency
dialog for A the Build environment puts B and C in the command line (seen
in the Librarian view of the project settings for A) an as a result I get
LNK4006 warnings all over the place.

So I am trying to establish dependencies such that A gets rebuilt if source
in B or C changes. What I am getting is that PLUS the linker is trying to
link the other static libs into A which it should not be doing.

This has got to be a bug right?


If you set a dll or lib as a dependant project in VC, the IDE
automagically tries to link its lib or export library to the dependee.
This can incredibly annoying for plug-in style DLL projects with
abstract DLL interfaces (but you wish to enforce a build order).
Luckily after many many many months of being annoyed at MS for this
behavior, I discovered it could be turned off with a rather esoteric
project setting.

For the dependant project, under the project properties

set 'Linker->Ignore Import Library' to 'Yes' and it will not cause other
projects which depend on it to link the import library generated by it.
And all will be sane and right in your universe.

Didn't work. I can't remember if it was ever any different but in VC 7.1
static lib projects don't have a linker options view. They have "Librarian"
view which doesn't have the ignore import lib option. I tried your suggestion
in the linker options for the exe but still get the same warnings when the
static lib project creates the lib. I have used project dependencies in many
projects and this the first time I have run into this. This is the first time
I have used 7.1 I have used 7.0 with no problem. I am going to verify on a
machine with 7.0 that it doesn't happen there.

Nov 17 '05 #4

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

Similar topics

3
by: Gawel | last post by:
Hajo, I have two dlls, both of them are compiled with /clr switch. In first dll project I have managed and unmanaged classes. One of the unmanaged I would like to use outside therefore I marked...
1
by: Kay | last post by:
I already specified to ignore specific library: MSVCPRT.lib MSVCRT.lib LIBC.lib MSVCRTD.lib LIBCD.lib command line is like: /INCREMENTAL /NOLOGO /DLL /NODEFAULTLIB:"MSVCPRT.lib MSVCRT.lib LIBC.lib...
2
by: ajikoe | last post by:
Hi, I tried to follow the example in swig homepage. I found error which I don't understand. I use bcc32, I already include directory where my python.h exist in bcc32.cfg. /* File : example.c...
3
by: Charles Nicholson | last post by:
Hello all- I have some static C++ libraries that I wrote in VS2003 but which upgraded fine when i went to VS2005 Pro. In them i overload the global versions of operators new, new, delete, and...
6
by: John | last post by:
I have 5 native static libraries that are being compiled in Visual Studio 2005 with the /MDd C Runtime option. I have 2 CLR DLLs (all managed code) in Visual Studio 2005 and the /MDd C Runtime...
0
by: zhenya.tkachenko | last post by:
Hi! Have a problem with mod_auth_mysql. Compilation and installation of module done ok: # /usr/local/apache/bin/apxs -c -L/usr/lib/mysql -I/usr/include/mysql -lmysqlclient -lm -lz...
2
by: Manuel T | last post by:
Hello everybody, I'm trying to port a project from Windows+Cygwin to Linux(i'm working on a Debian-like: Kubuntu), but I'm facing a lot of linking problems. This project needs libraries xerces...
3
by: Pixel.to.life | last post by:
Hi, Gurus, I recently attempted to build a .Net forms application, that links with old style unmanaged C++ static libs. Of course I had to recompile the static lib projects to link properly...
4
by: Markus Dahlbokum | last post by:
Hello, I'm trying to link python statically with qt and pyqt. I've tried this in several ways but never succeeded. At the moment the final make runs without errors but I get import errors when...
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
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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.