473,394 Members | 1,960 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,394 software developers and data experts.

VC++ .NET> Release Build results LNK2001, LNK2019 and LNK1120

Hello Developers,
I use VC++ .NET v2003. By using Windows Forms .NET, I am developing an
application which will work with TCP/IP functions. I can Build my application
in Debug Mode normally, but, whenever I want to Build at Release Mode,
compiler gives LNK2001, LNK2019 ve LNK1120 errors. I read the MSDN documents,
unfortunately, I could not solve my problem. I am requesting your help.

All errors are below with my application name "TestFace_v2"

1)TestFace_v2 error LNK2001: unresolved external symbol "int __stdcall
closesocket(unsigned int)" (?closesocket@@$$J14YGHI@Z)

2)TestFace_v2 error LNK2001: unresolved external symbol "int __stdcall
connect(unsigned int,struct sockaddr const *,int)"
(?connect@@$$J212YGHIPBUsockaddr@@H@Z)

3)TestFace_v2 error LNK2001: unresolved external symbol "int __stdcall
recv(unsigned int,char *,int,int)" (?recv@@$$J216YGHIPADHH@Z)

4)TestFace_v2 error LNK2001: unresolved external symbol "int __stdcall
recv(unsigned int,char *,int,int)" (?recv@@$$J216YGHIPADHH@Z)

5)TestFace_v2 error LNK2001: unresolved external symbol "int __stdcall
send(unsigned int,char const *,int,int)" (?send@@$$J216YGHIPBDHH@Z)

6)TestFace_v2 error LNK2001: unresolved external symbol "int __stdcall
setsockopt(unsigned int,int,int,char const *,int)"
(?setsockopt@@$$J220YGHIHHPBDH@Z)

7)TestFace_v2 error LNK2001: unresolved external symbol "int __stdcall
WSAGetLastError(void)" (?WSAGetLastError@@$$J10YGHXZ)

8)TestFace_v2 error LNK2001: unresolved external symbol "int __stdcall
WSAStartup(unsigned short,struct WSAData *)"
(?WSAStartup@@$$J18YGHGPAUWSAData@@@Z)

9)TestFace_v2 error LNK2001: unresolved external symbol "unsigned int
__stdcall socket(int,int,int)" (?socket@@$$J212YGIHHH@Z)

10)TestFace_v2 error LNK2001: unresolved external symbol "unsigned long
__stdcall inet_addr(char const *)" (?inet_addr@@$$J14YGKPBD@Z)

11)TestFace_v2 error LNK2001: unresolved external symbol "unsigned short
__stdcall htons(unsigned short)" (?htons@@$$J14YGGG@Z)

12)TestFace_v2 error LNK2019: unresolved external symbol "int __stdcall
WSAGetLastError(void)" (?WSAGetLastError@@$$J10YGHXZ) referenced in function
"public: __clrcall
TestFace_v2::frmConnectionSettings::frmConnectionS ettings(void)__gc "
(??0frmConnectionSettings@TestFace_v2@@$$FQ$AAM@XZ )

13)TestFace_v2 fatal error LNK1120: 10 unresolved externals

Nov 22 '05 #1
10 3357

Is ws2_32.lib present in the list of import libraries in Release configuration?

(Project properties | Configuration Properties | Linker | Input | Additional Dependencies)

Regards,
Oleg


Nov 22 '05 #2
Hello,
Yes, "ws2_32.lib" is already in "Additional Dependencies" part where you
mentioned.

Best Regards,
Bil Muh
"Oleg Starodumov" wrote:

Is ws2_32.lib present in the list of import libraries in Release configuration?

(Project properties | Configuration Properties | Linker | Input | Additional Dependencies)

Regards,
Oleg


Nov 22 '05 #3
Yes, "ws2_32.lib" is already in "Additional Dependencies" part where you
mentioned.


Add /verbose:lib to the list of linker options. Then when linking, the list
of libraries searched will be displayed in Output window.

Will ws2_32.lib be present in that list, and in the correct location,
when you build the release configuration?

Regards,
Oleg


Nov 22 '05 #4
Can you kindly tell me exactly where to put /verbose::lib ? I am sorry, I
didnot understand it

"Oleg Starodumov" wrote:
Yes, "ws2_32.lib" is already in "Additional Dependencies" part where you
mentioned.


Add /verbose:lib to the list of linker options. Then when linking, the list
of libraries searched will be displayed in Output window.

Will ws2_32.lib be present in that list, and in the correct location,
when you build the release configuration?

Regards,
Oleg


Nov 22 '05 #5
Can you kindly tell me exactly where to put /verbose::lib ? I am sorry, I
didnot understand it


Project properties | Configuration Properties | Linker | Command Line |
Additional Options.

Regards,
Oleg


Nov 22 '05 #6
I have written /verbose::lib into that place before your answer.
Unfortunately, it still gives the LNK2001 error for all WinSock functions,
when I build in Release Mode.
"Oleg Starodumov" wrote:
Can you kindly tell me exactly where to put /verbose::lib ? I am sorry, I
didnot understand it


Project properties | Configuration Properties | Linker | Command Line |
Additional Options.

Regards,
Oleg


Nov 22 '05 #7
I have written /verbose::lib into that place before your answer.
Unfortunately, it still gives the LNK2001 error for all WinSock functions,
when I build in Release Mode.


/verbose option does not affect the outcome of linking, it only provides
some troubleshooting output in build output window.
Please look at that window and see whether the linker was able to find ws2_32.lib.
Also compare the output with debug build, to see if there are differences.

Regards,
Oleg


Nov 22 '05 #8
I re-compile as you mentioned. Unfortunately, ws2_32.lib is not listed at
Release Build at the Output file. Also, I compare the Debug Output file and
Release output File. The only differenece is the lack of "ws2_32.lib" at
Release Build file.

Thank you in advance
Best Regards.
Alper
Nov 22 '05 #9
I re-compile as you mentioned. Unfortunately, ws2_32.lib is not listed at
Release Build at the Output file. Also, I compare the Debug Output file and
Release output File. The only differenece is the lack of "ws2_32.lib" at
Release Build file.


It means that ws2_32.lib is not specified in the list of import libraries.

Please check again Project Settings | Configuration Properties | Linker | Input |
Additional Dependencies, and make sure that ws2_32.lib is there.
Make sure that when you check it, Release is selected in Configuration listbox
at the top of the dialog page.

If it does not help, try to add ws2_32.lib to your project explicitly (in the same way
as you would add an ordinary source file).

Regards,
Oleg


Nov 22 '05 #10
I thank you very much. With your guidance, I solved the problem. The thing
that I did not noticed that is the "Configuration" combobox at the Project
Properties menu. When I was adding the "ws2_32.lib" to the Linker > Input >
Additional Dependencies, the "Configuration" combobox was setted to Debug.
Now, I added ws2_32.lib to all configurations.
I think that, when adding dependencies, it is better to add when the
"Configuration" combo-box is setted to "All Configurations"

"Oleg Starodumov" wrote:
I re-compile as you mentioned. Unfortunately, ws2_32.lib is not listed at
Release Build at the Output file. Also, I compare the Debug Output file and
Release output File. The only differenece is the lack of "ws2_32.lib" at
Release Build file.


It means that ws2_32.lib is not specified in the list of import libraries.

Please check again Project Settings | Configuration Properties | Linker | Input |
Additional Dependencies, and make sure that ws2_32.lib is there.
Make sure that when you check it, Release is selected in Configuration listbox
at the top of the dialog page.

If it does not help, try to add ws2_32.lib to your project explicitly (in the same way
as you would add an ordinary source file).

Regards,
Oleg


Nov 22 '05 #11

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Sean | last post by:
I am frustrated by the issue, and looking for a workaround. I have a dropdown list, and a button and some other controls on the page. When the button is clicked, I need to ensure a valid dropdown...
10
by: Bil Muh | last post by:
Hello Developers, I use VC++ .NET v2003. By using Windows Forms .NET, I am developing an application which will work with TCP/IP functions. I can Build my application in Debug Mode normally, but,...
3
by: Julian | last post by:
Build.Net is a build tool that parses and builds VS.NET project files. Build.Net is run from the command line. It recursively searches a directory for VS.NET project files to build. This...
0
by: Jenksa | last post by:
I'm converting our current VS6.0 build system to support VC in Net 2003. I've sucessfully decoded the doc on using the DevDTE object, and can build a fully specified solution. Unfortunately, I need...
4
by: Peteroid | last post by:
I have a process that takes a long (i.e., sometimes minutes) to accomplish, and I'd rather not write it as a 'time-slicing' process. Is there some sort of Windows call that will allow this process...
0
by: | last post by:
Hi all, running the following code as an console application: #include <locale> #include <iostream> #include <sstream> #include <tchar.h> using namespace std;
11
friendjin
by: friendjin | last post by:
I got a problem about Release. I really appericiate if anyone could give me a help. The problem is when I ran it in another computer. an exception will be displayed "application has generated an...
0
by: =?Utf-8?B?c3Bhcmtlcg==?= | last post by:
Has anybody had the occasion to to build a VB.NET 2008 application that will manipulate an Excel workbook including the Hyperion Essbase Plugin? I was not sure which forum to post this question in...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.