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

linker problem LNK4089 with WS2_32.dll

P: n/a
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
__imp__WSACleanup@0 referenced in function "public: __thiscall
ATL::_AtlWSAInit::~_AtlWSAInit(void)" (??1_AtlWSAInit@ATL@@QAE@XZ)
EtvData.obj : error LNK2001: unresolved external symbol __imp__WSACleanup@0
helper.obj : error LNK2019: unresolved external symbol __imp__WSACleanup@0
referenced in function "public: void * __thiscall ATL::CSecBuffer::`vector
deleting destructor'(unsigned int)" (??_ECSecBuffer@ATL@@QAEPAXI@Z)
MAPITable.obj : error LNK2001: unresolved external symbol
__imp__WSACleanup@0
Release/ETVAB32.dll : fatal error LNK1120: 1 unresolved externals

How do I resolve this problem (except suppressing the warning somehow)?

Eric
Jul 22 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
I have received this warning for all my life and never care about it.

--
Ravi Ambros Wallau
r w a l l a u @ s p r i n g w i r e l e s s . n e t

"Eric" <ba********@kull.ch.nospam.me.com> wrote in message
news:cl**********@newshispeed.ch...
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
__imp__WSACleanup@0 referenced in function "public: __thiscall
ATL::_AtlWSAInit::~_AtlWSAInit(void)" (??1_AtlWSAInit@ATL@@QAE@XZ)
EtvData.obj : error LNK2001: unresolved external symbol
__imp__WSACleanup@0
helper.obj : error LNK2019: unresolved external symbol __imp__WSACleanup@0
referenced in function "public: void * __thiscall ATL::CSecBuffer::`vector
deleting destructor'(unsigned int)" (??_ECSecBuffer@ATL@@QAEPAXI@Z)
MAPITable.obj : error LNK2001: unresolved external symbol
__imp__WSACleanup@0
Release/ETVAB32.dll : fatal error LNK1120: 1 unresolved externals

How do I resolve this problem (except suppressing the warning somehow)?

Eric

Jul 22 '05 #2

P: n/a
Eric wrote:
Hello

I receive (only in Release build) the following linker warning:

LINK : warning LNK4089: all references to 'WS2_32.dll' discarded by

/OPT:REF

[snip]

Please note - this is comp.lang.c++ and (having cunningly read your
mind - and your annoyingly long list of cross-posted NGs - as to your
platform/compiler):

C++ language != MS Windows programming

C++ language != MS Windows programming in VC++, .NET, whatever

C++ language != linking on specific platforms (or linking at all, for
that matter)

You are way OT. Go somewhere else.

PS. Your Help system tells you *exactly* why you are getting that
warning. Look it up, then troll off.

--
Lionel B

Jul 22 '05 #3

P: n/a
Eric wrote:
I receive (only in Release build) the following linker warning:

LINK : warning LNK4089: all references to 'WS2_32.dll' discarded by
/OPT:REF


just live with it. It's no indication of any problem with your code, it
just means that WS2_32.dll file will not be necessary to run your app.
It does *not* however mean that its coresponding .lib is not used by
your app, as you can clearly see by other error message.
B.

Jul 22 '05 #4

P: n/a
"Eric" <ba********@kull.ch.nospam.me.com> wrote in message news:cl**********@newshispeed.ch...
LINK : warning LNK4089: all references to 'WS2_32.dll' discarded by /OPT:REF
How do I resolve this problem (except suppressing the warning somehow)?


Sometimes, there are libraries in your project settings which
you aren't really using. But this is not always the case. Some
of the Microsoft header files contain pragma's that add libraries
to the compilation, even if your EXE won't actually need them.
The LNK4089 warning is the linker telling you that it was
able to eliminate dependence on some DLL's and make your
EXE smaller. I don't like seeing the LNK4089 warnings myself.
The solution is to add

/IGNORE:4089

to your Linker, "Command Line" project settings. That's all you
have to do.

Jul 22 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.