linker problem LNK4089 with WS2_32.dll

E

Eric

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
 
L

Lionel B

Eric said:
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.
 
B

Bronek Kozicki

Eric said:
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.
 
K

Klueless

Eric said:
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.
 

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

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,578
Members
45,052
Latest member
LucyCarper

Latest Threads

Top