473,725 Members | 2,276 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Linker Warning LNK4089

Hello friends,

I have an issue with a linker warning. It is the warning LNK4089. I am
working in MSVC6.0

I investigated and this warning tells that the import of the library
to which it makes reference is redundant, thus the linker ignores that
library in order to make the code smaller. As it is expected, it only
appears for release versions.

Everybody recommends to disable the warning using a linker directive,
but I would not prefer to do so.

I did not include the conflictive library and I get some errors, that
some symbols could not be found. Here it is where it becomes tricky,
because if I do not link with the specified library the linker does
not find symbols, and if I include the library the linker says that
the library is not used at all (if my hypothesis is right).

Now I tracked further and the functions of this library are used in
another module, which is linked with the module in which I get the
warning.

This module where the functions are used is a static library, and I do
not get the linker tab in the "Properties " submenu for the required
module. That is to say, for DLLs I have a "Linker" tab, where I
include the library I want to use, but for static libraries I do not
have this option (always using the MSVC6.0 IDE).

My hypothesis is that the linker, when trying to link all, realises
that the main module does not use these functions, throwing the
warning. But if I exclude the library from this module, the library is
not linked with the static library in which the function calls take
place and the linker throws an error.

Any idea or suggestion of how to handle this case? Thanks in advance!

Jun 19 '07 #1
2 2784
On 2007-06-19 10:55, Oneironaut wrote:
Hello friends,

I have an issue with a linker warning. It is the warning LNK4089. I am
working in MSVC6.0

I investigated and this warning tells that the import of the library
to which it makes reference is redundant, thus the linker ignores that
library in order to make the code smaller. As it is expected, it only
appears for release versions.

Everybody recommends to disable the warning using a linker directive,
but I would not prefer to do so.

I did not include the conflictive library and I get some errors, that
some symbols could not be found. Here it is where it becomes tricky,
because if I do not link with the specified library the linker does
not find symbols, and if I include the library the linker says that
the library is not used at all (if my hypothesis is right).

Now I tracked further and the functions of this library are used in
another module, which is linked with the module in which I get the
warning.

This module where the functions are used is a static library, and I do
not get the linker tab in the "Properties " submenu for the required
module. That is to say, for DLLs I have a "Linker" tab, where I
include the library I want to use, but for static libraries I do not
have this option (always using the MSVC6.0 IDE).

My hypothesis is that the linker, when trying to link all, realises
that the main module does not use these functions, throwing the
warning. But if I exclude the library from this module, the library is
not linked with the static library in which the function calls take
place and the linker throws an error.

Any idea or suggestion of how to handle this case? Thanks in advance!
The word redundant suggests to me that it claims that the library is
included twice (one statically and once dynamically), not that the
functions are not used. Anyway, this is very platform specific and off-
topic for this group. Try asking in one of the
microsoft.publi c.vstudio.* or microsoft.publi c.vc.* groups, that's where
you'll find the experts on Visual C++.

PS: VC++ 6 is *really* old (somewhere around the dark ages in computer
time) so unless you have some good reason not to, look into upgrading to
something more modern, Visual C++ 2005 Express, as an example, is a free
download from Microsoft.

--
Erik Wikström
Jun 19 '07 #2
On Jun 19, 5:55 pm, Oneironaut <lucas.puc...@g mail.comwrote:
Hello friends,

I have an issue with a linker warning. It is the warning LNK4089. I am
working in MSVC6.0

I investigated and this warning tells that the import of the library
to which it makes reference is redundant, thus the linker ignores that
library in order to make the code smaller. As it is expected, it only
appears for release versions.

Everybody recommends to disable the warning using a linker directive,
but I would not prefer to do so.

I did not include the conflictive library and I get some errors, that
some symbols could not be found. Here it is where it becomes tricky,
because if I do not link with the specified library the linker does
not find symbols, and if I include the library the linker says that
the library is not used at all (if my hypothesis is right).

Now I tracked further and the functions of this library are used in
another module, which is linked with the module in which I get the
warning.

This module where the functions are used is a static library, and I do
not get the linker tab in the "Properties " submenu for the required
module. That is to say, for DLLs I have a "Linker" tab, where I
include the library I want to use, but for static libraries I do not
have this option (always using the MSVC6.0 IDE).

My hypothesis is that the linker, when trying to link all, realises
that the main module does not use these functions, throwing the
warning. But if I exclude the library from this module, the library is
not linked with the static library in which the function calls take
place and the linker throws an error.

Any idea or suggestion of how to handle this case? Thanks in advance!
this is platform specfic question and better to approach microsoft
newsgroup

regards,
sarath

Jun 19 '07 #3

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

Similar topics

0
1812
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 the library in Linker-General-Addition Library Directories field under the Project options. The first question I have is....is this the correct way to include a static library. If not, then what is the correct way to do it (I need to make .NET...
0
1629
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 the library in Linker-General-Addition Library Directories field under the Project options. The first question I have is....is this the correct way to include a static library. If not, then what is the correct way to do it (I need to make .NET...
3
3908
by: Michel Rosien | last post by:
Hello All, I'm getting the following linker warning: (I'm using Borland C++ Builder 6) Public symbol '_STL::basic_ostream<char, _STL::char_traits<char> >& _STL::operator << (_STL::basic_ostream<char, _STL::char_traits<char> >&, const signed char *)' defined in both module C:\ROSIEN\MONTIUM\SIMULATOR\MONTIUMSIMUTILITY.OBJ and C:\ROSIEN\HIGH2\BASICSIMULATOR.OBJ
4
4867
by: Eric | last post by:
Hello I receive (only in Release build) the following linker warning: LINK : warning LNK4089: all references to 'WS2_32.dll' discarded by /OPT:REF If I set WS2_32.lib in project properties under ignore specific library, then I receive: ABContainer.obj : error LNK2019: unresolved external symbol
2
8642
by: Zarnywoop | last post by:
Hi, Could someone offer a solution to the following issue I have with vc7.1. With VC6 it was possible to turn off linker warnings with a #pragma comment( linker, "/ignore:4049" ) line in the source. With VC7.1 the linker now reports that /ignore is unrecognised, and sure enough when consulting the docs. the option is no
3
1935
by: Ryan | last post by:
My project uses the /ORDER specifier to order functions as specified in file containing the decorated names of packaged functions (COMDATs). I am in the process of upgrading from VC6 to VC.NET 2003. When linking a release build of my project VC.NET 2003, the following warning occurs for each function that is being ordered: SUTL_X86OrderComdats.dat : warning LNK4065: '?SUTL_SomeFunction@@YAXXZ' cannot be ordered; ignored The help for...
1
3597
by: Boris | last post by:
When I compile my "mixed-mode" C++ dll in Release mode, I get these warnings - LINK : warning LNK4243: DLL containing objects compiled with /clr is not linked with /NOENTRY; image may not run correctly LINK : warning LNK4089: all references to 'MSVCP71.dll' discarded by /OPT:REF LINK : warning LNK4089: all references to 'OLEAUT32.dll' discarded by /OPT:REF LINK : warning LNK4089: all references to 'USER32.dll' discarded by /OPT:REF
6
1888
by: Bonj | last post by:
Hi I have a project that consists of an unmanaged DLL (extended stored procedure) and a static library, which I have converted to managed, although it has got one unmanaged function which is exported to the unmanaged. I keep getting the linker warning 'warning - images compiled with /NOENTRY may not run correctly'. It doesn't seem to have any adverse effects, but what does it mean and how do I get rid of it?
5
5389
by: Tanja Krammer | last post by:
Hi experts, is it possible to disable linker warnings (i.e. LNK4204)? Thanx
0
9401
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9257
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9179
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8099
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6011
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4519
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4784
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3228
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2157
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.