473,385 Members | 2,180 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

linker problem LNK4089 with WS2_32.dll

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
4 4827
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
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
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
"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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Pankaj Bhagat | last post by:
Hi, This is in context with compiler and linker Can someone let me know 1) what is a binder? where is it needed? What does it do in a compiling process? ----------------- 2) When I have a...
1
by: mariox | last post by:
Hi everybody, compiling a program I receive this message: Fatal: Unable to open file 'WS2_32.OBJ' Object file "programName.OBJ" is created, but I can't link it. Anyone can help me, please?...
2
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...
1
by: ComputerGanesh | last post by:
" The procedure entry point getaddrinfo could not be located in dynamic link library WS2_32.dll " error is occured while running my app. I don't know how to clear this error. Please reply me....
1
by: run | last post by:
My enveronment - IE6 - .Net 1.1 sp1 - Windows 2000 sp4 I cannot use function "CSMTPConnection" on Vc++.Net on Windows 2000. because WS2_32.dll on error message as "The procedure entry point...
0
by: Yogesh Ketkar | last post by:
I have a asp .net application talking to some remoting objects. application hosting remoting objects runs on the same machine. From a last couple of days I have started getting...
6
Rabbit
by: Rabbit | last post by:
So the tutorial says I need to do this, unfortunately I'm using DevC++. I was looking through the menus and I found the "Further object files or linker options" under project options. So I thought...
2
by: Oneironaut | last post by:
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...
1
by: Deepath G | last post by:
This is deepath.. I am getting some linker error when i am trying to connect Websphere MQ using Borland C++ Builder 2006 using imqi.hpp on windows. Error Message ----------------------- ...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

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.