Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

compiling netcat/cryptcat

Status
Not open for further replies.

grnfvr

MIS
Dec 21, 2000
111
0
0
US
I don't know if anybody has any experience compiling netcat or cryptcat on vis studio c++. I obtained the windows source files from
then I created a project in vis studio and added all of the c++ files that came in the download to that project. then when I build netcat.c I get the following errors:
-------------------Configuration: NETCAT - Win32 Debug--------------------
Linking...
NETCAT.OBJ : error LNK2001: unresolved external symbol _WSACleanup@0
NETCAT.OBJ : error LNK2001: unresolved external symbol _WSAStartup@8
NETCAT.OBJ : error LNK2001: unresolved external symbol _WSAGetLastError@0
NETCAT.OBJ : error LNK2001: unresolved external symbol _closesocket@4
NETCAT.OBJ : error LNK2001: unresolved external symbol _gethostbyaddr@12
NETCAT.OBJ : error LNK2001: unresolved external symbol _inet_ntoa@4
NETCAT.OBJ : error LNK2001: unresolved external symbol _gethostbyname@4
NETCAT.OBJ : error LNK2001: unresolved external symbol _inet_addr@4
NETCAT.OBJ : error LNK2001: unresolved external symbol _getservbyname@8
NETCAT.OBJ : error LNK2001: unresolved external symbol _ntohs@4
NETCAT.OBJ : error LNK2001: unresolved external symbol _getservbyport@8
NETCAT.OBJ : error LNK2001: unresolved external symbol _htons@4
NETCAT.OBJ : error LNK2001: unresolved external symbol _connect@12
NETCAT.OBJ : error LNK2001: unresolved external symbol _bind@12
NETCAT.OBJ : error LNK2001: unresolved external symbol _setsockopt@20
NETCAT.OBJ : error LNK2001: unresolved external symbol _socket@12
NETCAT.OBJ : error LNK2001: unresolved external symbol _WSASetLastError@4
NETCAT.OBJ : error LNK2001: unresolved external symbol _accept@12
NETCAT.OBJ : error LNK2001: unresolved external symbol _recvfrom@24
NETCAT.OBJ : error LNK2001: unresolved external symbol _getsockname@12
NETCAT.OBJ : error LNK2001: unresolved external symbol _listen@8
NETCAT.OBJ : error LNK2001: unresolved external symbol _send@16
NETCAT.OBJ : error LNK2001: unresolved external symbol _select@20
NETCAT.OBJ : error LNK2001: unresolved external symbol ___WSAFDIsSet@8
farm9crypt.obj : error LNK2001: unresolved external symbol _recv@16
twofish2.obj : error LNK2001: unresolved external symbol __imp__send@16
Debug/NETCAT.exe : fatal error LNK1120: 26 unresolved externals
Error executing link.exe.

NETCAT.exe - 27 error(s), 0 warning(s)

----------------------------------------------

I want to be able to compile it myself so that i can alter it to force a pasword authentication before a listening instance of netcat will accept a connection.

Thanks,
Matt
 
Hi Matt.

Add WSock32.Lib to the list of libraries used by the linker.
(VC6: Project Settings > Link > Object/library modules)

Alternatively, you may add the following statement to the source code: #pragma comment(lib, "WSock32")

It has the same effect.
 
Thanks, it worked. How did you know which library? is there a way to tell based on the errors, other than just knowing, that Wsock32.lib is the one that contains those unresolved symbols?
 
> is there a way to tell based on the errors, other
> than just knowing, that Wsock32.lib is the one that
> contains those unresolved symbols?

Yes. The error messages show you which symbols are
undefined, e.g. "_getsockname@12".
In the MSDN you find a description of getsockname().
At the bottom of the text there is an information
like this:

---
Requirements
Windows NT/2000/XP: Included in Windows NT 3.1 and later.
Windows 95/98/Me: Included in Windows 95 and later.
Header: Declared in Winsock2.h.
Library: Use Wsock32.lib.
---

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top