Previous Thread
Next Thread
Print Thread
Rate Thread
#17272 08/17/03 04:00 PM
Joined: Jun 2003
Posts: 14
V
Junior Member
Junior Member
V Offline
Joined: Jun 2003
Posts: 14
When I compile my program, it compiles without an error. When I try to build it into an EXE, this is the error I keep getting. Any ideas on what this may be from?

Code
--------------------Configuration: main - Win32 Release--------------------
Linking...
main.obj : error LNK2001: unresolved external symbol _listen@8
main.obj : error LNK2001: unresolved external symbol _closesocket@4
main.obj : error LNK2001: unresolved external symbol _bind@12
main.obj : error LNK2001: unresolved external symbol _socket@12
main.obj : error LNK2001: unresolved external symbol _htons@4
main.obj : error LNK2001: unresolved external symbol _gethostbyname@4
main.obj : error LNK2001: unresolved external symbol _gethostname@8
main.obj : error LNK2001: unresolved external symbol _send@16
main.obj : error LNK2001: unresolved external symbol _recv@16
main.obj : error LNK2001: unresolved external symbol _accept@12
Release/main.exe : fatal error LNK1120: 10 unresolved externals
Error executing link.exe.

main.exe - 11 error(s), 0 warning(s)

Sponsored Links
▼ Sponsored Links ▼ ▲ Sponsored Links ▲
#17273 08/17/03 09:59 PM
Joined: Mar 2002
Posts: 1,273
DollarDNS Owner
DollarDNS Owner
Joined: Mar 2002
Posts: 1,273
include wsock32.lib in your link, that is, if it's a windows program you're compiling.


Domain Registration, Hosting, Management
http://www.dollardns.net
#17274 11/03/03 10:55 AM
Joined: Mar 2002
Posts: 93
Junior Member
Junior Member
Joined: Mar 2002
Posts: 93
yeah... to help him out, explaining the basics..


When a compiler generates such errors it's (very often) because it doesn't recognise the used commands/variables/ops/function calls
.
In your case, the unrecognized are:
_listen@8
_closesocket@4
and so on... (you get it)..

those function calls are surely, like SilentRage said, defined in the wsock32.lib .....
Yep...
that's why.

Hope you got some light into it,,,


- "It's not my code that's useless
it's you loosers being unable to
apprecitate it because of your
lack of skills!"
/zenon - C++ master Apprentice
#17275 12/21/03 09:47 PM
Joined: Dec 2003
Posts: 38
Junior Member
Junior Member
Joined: Dec 2003
Posts: 38
Using visual studio I usually get similar errors when I create a project and build the main .cpp file and forget to add all of the header file implementation files, you know the actual code to a non-template header. Just in case you don't need IMP files with every non-template header, I didn't know. I'm fairly new to C++.


Link Copied to Clipboard
Member Spotlight
None yet
Forum Statistics
Forums41
Topics33,840
Posts68,858
Members2,176
Most Online3,253
Jan 13th, 2020
Latest Postings
Top Posters
UGN Security 41,392
Gremelin 7,203
§intå× 3,255
SilentRage 1,273
Ice 1,146
pergesu 1,136
Infinite 1,041
jonconley 955
Girlie 908
unreal 860
Top Likes Received
Ghost 2
Dartur 1
Cyrez 1
Girlie 1
unreal 1
Powered by UBB.threads™ PHP Forum Software 8.0.0