Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Visual Studio.NET / General / June 2005

Tip: Looking for answers? Try searching our database.

Adding a library to the commandline

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
programmer 0000 0001 - 29 Jun 2005 15:21 GMT
I am using Visual C++ .NET, and I was getting the error message:
"WinSock
test project error LNK2001: unresolved external symbol "int __stdcall
WSAStartup(unsigned short,struct WSAData *)"
(?WSAStartup@@$$J18YGHGPAUWSAD­ata@@@Z)
"

My code is as follows:

#include <winsock2.h>

int main()
{
 WSADATA wsaData;

 int iResult = WSAStartup( MAKEWORD(2,2), &wsaData );

}

I went to msdn.com and didn't find it very helpful.

I was able to resolve this error by adding "ws2_32.lib", by way of
the project properties pages, accessing the "Linker" setting and adding
the library to the "Command Line" through the "Addition Options:" text
box.

Though adding the library works and I get no more errors for this
specific project. I need to be able to add to/modify the command line
text so that all future projects I do have a default access to this
library.

Above the "Additional Options:" text box there is an "All Options:"
text box which list the libraries and other included files but it only
lets you delete from it and not add.

Additional information:
Inside the "All Options:" text box is as follows:

/OUT:"E:\Documents and Settings\Juan\My Documents\Visual Studio
Projects\Test files\CreateProcess\WinSock
Para_Pass\WinSock_PP\Debug\WinSock_PP.exe" /INCREMENTAL /NOLOGO /DEBUG
/ASSEMBLYDEBUG /PDB:"E:\Documents and Settings\Juan\My Documents\Visual
Studio Projects\Test files\CreateProcess\WinSock
Para_Pass\WinSock_PP\Debug/WinSock_PP.pdb" /FIXED:No   kernel32.lib
user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib
ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib

I would like to permanently attach "ws2_32.lib" to this command line.

-thanks
supra - 29 Jun 2005 16:26 GMT
winsock doesn't work in vs2003 and can't used api function. the vc++.net comes with bild socket....look in NET in object browser. but i'm using vb.net
using vs2003.
regards

> I am using Visual C++ .NET, and I was getting the error message:
> "WinSock
[quoted text clipped - 46 lines]
>
> -thanks

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.