unresolved external symbol "a whole bunch of em"

Please support our C advertiser: Programming Forums - DaniWeb Sister Site
Reply

Join Date: Dec 2004
Posts: 151
Reputation: Geek-Master is an unknown quantity at this point 
Solved Threads: 6
Geek-Master's Avatar
Geek-Master Geek-Master is offline Offline
Junior Poster

unresolved external symbol "a whole bunch of em"

 
0
  #1
Mar 23rd, 2005
Hey everyone, I'm working on my first program using "Winsock2.h".

I'm getting back linker errors "error LNK2001: unresolved external symbol ..."
9 unresolved externals total

The program came from an MSDN tutorial: "A simple winsock program", its a simple ping program that sends packets to a loopback address.

when I include winsock2.h I use
  1. #include <stdio.h> // for printf
  2. #include "winsock2.h"

I'm sure its got something to do with define, but I've never worked with that in my programs before. If someone can point me to a tutorial, I'd be very happy. Thanks for viewing.
If in doubt, reach into the trash can and remove the user guide.
Reply With Quote Quick reply to this message  
Join Date: Sep 2004
Posts: 7,850
Reputation: Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute 
Solved Threads: 754
Team Colleague
Narue's Avatar
Narue Narue is offline Offline
Senior Bitch

Re: unresolved external symbol "a whole bunch of em"

 
0
  #2
Mar 24th, 2005
Did you link to wsock32.lib?
New members chased away this month: 4
Reply With Quote Quick reply to this message  
Join Date: Dec 2004
Posts: 151
Reputation: Geek-Master is an unknown quantity at this point 
Solved Threads: 6
Geek-Master's Avatar
Geek-Master Geek-Master is offline Offline
Junior Poster

Re: unresolved external symbol "a whole bunch of em"

 
0
  #3
Mar 24th, 2005
I googled for how to link a library and haven't found anything yet.
I'm using Visual Studio .NET for my C++ compiler. Some webpages that google turned up say that you can go into "Project" --> "Settings" --> "Linker" but there isn't a tab for settings under "Project". I guess thats a 6.0 thing and not a .NET thing.

I will be searching and google'n some more on how to link. I will also be checking up on here every now and then if you, Narue, have any info on how to link using .NET. Thanks for the help.
Last edited by Geek-Master; Mar 24th, 2005 at 1:56 pm. Reason: it needed something more ^^
If in doubt, reach into the trash can and remove the user guide.
Reply With Quote Quick reply to this message  
Join Date: Dec 2004
Posts: 151
Reputation: Geek-Master is an unknown quantity at this point 
Solved Threads: 6
Geek-Master's Avatar
Geek-Master Geek-Master is offline Offline
Junior Poster

Re: unresolved external symbol "a whole bunch of em"

 
0
  #4
Mar 24th, 2005
I searched on how to link Wsock32.LIB and found out how.

  1. #include <stdio.h> // for printf
  2. #include "winsock2.h"
  3.  
  4. #pragma comment( lib, "wsock32.lib" ) // This will link to wsock32.lib
  5.  
  6. void main()
  7. {
  8. // Winsock stuff
  9. }

I just typed in that little line and bam... everything a...o...k.
If in doubt, reach into the trash can and remove the user guide.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:




Views: 20647 | Replies: 3
Thread Tools Search this Thread



Tag cloud for C
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC