UGN Security Forums
My ProfileMember DirectoryLogin
Search our ForumsView our FAQView our Site Rules
View our CalendarView our Active TopicsGo to our Main Page

UGN Security Store
 

Network Sites UGN Security, The GoNix Initiative, Elite Web Gamers, Back of the Web, EveryDay Helper, VNC Web Design & Development
August
Su M Tu W Th F Sa
1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30
31
Sponsored Links
Latest Postings
Latest Reviews
Topic Options
Rate This Topic
#17272 - 08/18/03 01:00 AM Linking error?
visage Offline
Junior Member

Registered: 06/12/03
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)

Top
Sponsored Links
      
#17273 - 08/18/03 06:59 AM Re: Linking error?
SilentRage Offline
DollarDNS Owner

Registered: 03/04/02
Posts: 1273
Loc: OH, USA
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

Top
#17274 - 11/03/03 06:55 PM Re: Linking error?
zenon Offline
Junior Member

Registered: 03/31/02
Posts: 93
Loc: Sweden
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

Top
#17275 - 12/22/03 05:47 AM Re: Linking error?
acid45 Offline
Junior Member

Registered: 12/19/03
Posts: 38
Loc: canada
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++.

Top

Featured Member
Registered: 08/21/13
Posts: 1
Forum Stats
2146 Members
46 Forums
33853 Topics
69020 Posts

Max Online: 1567 @ 04/25/10 10:20 AM
Top Posters
UGN Security 27016
Gremelin 7192
§intå× 3255
SilentRage 1273
Ice 1146
pergesu 1136
Infinite 1041
jonconley 955
Girlie 908
unreal 860
Newest Members
Devo60, ali, lavos, Zanvin Green, Daktologist
2145 Registered Users
Who's Online
0 registered (), 307 Guests and 326 Spiders online.
Key: Admin, Global Mod, Mod
Latest News


Donate
  Get Firefox!
Get FireFox!