linker problem 2

Please support our C++ advertiser: Intel Parallel Studio Home
Reply

Join Date: Aug 2006
Posts: 254
Reputation: jan1024188 is an unknown quantity at this point 
Solved Threads: 2
jan1024188's Avatar
jan1024188 jan1024188 is offline Offline
Posting Whiz in Training

linker problem 2

 
0
  #1
Jun 24th, 2007
Hello,

I edited a source code I found on a net and now it compiles well. I get a linker error.
  1. 1>Linking...
  2. 1>MSVCRT.lib(crtexe.obj) : error LNK2001: unresolved external symbol _main
  3. 1>C:\Users\jan\Documents\Visual Studio 2005\Projects\YAST server console\Release\YAST server console.exe : fatal error LNK1120: 1 unresolved externals
  4. 1>Build log was saved at "file://c:\Users\jan\Documents\Visual Studio 2005\Projects\YAST server console\YAST server console\Release\BuildLog.htm"
  5. 1>YAST server console - 2 error(s), 0 warning(s)
  6. ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

I have included:
  1. #include <stdlib.h>
  2. #include <windows.h>
  3. #include <winsock.h>
  4. #include <stdio.h>
  5. #include <commctrl.h>
  6. #include <Winuser.h>
  7. #include <iostream>
  8. #include <time.h>
  9. #include <mmsystem.h>

and this is in my liker options:
  1. ws2_32.lib wsock32.lib winmm.lib

What else do I have to add to linker options?
Reply With Quote Quick reply to this message  
Join Date: Aug 2005
Posts: 15,454
Reputation: Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute 
Solved Threads: 1476
Team Colleague
Featured Poster
Ancient Dragon's Avatar
Ancient Dragon Ancient Dragon is online now Online
Still Learning

Re: linker problem 2

 
0
  #2
Jun 24th, 2007
The error indicates the program does not have a main() function -- maybe you did not create the correct type of project, such as you created a console project when you should have created a windows project.
Don't PM me with questions -- you might get a nasty PM in response. If you have a question then post it in one of the forums.
Reply With Quote Quick reply to this message  
Join Date: Aug 2006
Posts: 254
Reputation: jan1024188 is an unknown quantity at this point 
Solved Threads: 2
jan1024188's Avatar
jan1024188 jan1024188 is offline Offline
Posting Whiz in Training

Re: linker problem 2

 
0
  #3
Jun 24th, 2007
hmm...you are right...
Reply With Quote Quick reply to this message  
Reply

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



Similar Threads
Other Threads in the C++ Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC