Linker Warning LNK4089

O

Oneironaut

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!
 
?

=?ISO-8859-1?Q?Erik_Wikstr=F6m?=

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.public.vstudio.* or microsoft.public.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.
 
S

Sarath

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

No members online now.

Forum statistics

Threads
473,999
Messages
2,570,243
Members
46,836
Latest member
login dogas

Latest Threads

Top