By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,377 Members | 3,052 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,377 IT Pros & Developers. It's quick & easy.

Linker Warning LNK4089

P: n/a
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
Share this Question
Share on Google+
2 Replies


P: n/a
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.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.

--
Erik Wikström
Jun 19 '07 #2

P: n/a
On Jun 19, 5:55 pm, Oneironaut <lucas.puc...@gmail.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 discussion thread is closed

Replies have been disabled for this discussion.