944,123 Members | Top Members by Rank

Ad:
  • C++ Discussion Thread
  • Unsolved
  • Views: 1556
  • C++ RSS
Jun 24th, 2007
0

linker problem 2

Expand Post »
Hello,

I edited a source code I found on a net and now it compiles well. I get a linker error.
C++ Syntax (Toggle Plain Text)
  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:
C++ Syntax (Toggle Plain Text)
  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:
C++ Syntax (Toggle Plain Text)
  1. ws2_32.lib wsock32.lib winmm.lib

What else do I have to add to linker options?
Similar Threads
Reputation Points: 27
Solved Threads: 2
Posting Whiz in Training
jan1024188 is offline Offline
254 posts
since Aug 2006
Jun 24th, 2007
0

Re: linker problem 2

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.
Sponsor
Team Colleague
Featured Poster
Reputation Points: 5608
Solved Threads: 2283
Retired and Enjoying Life
Ancient Dragon is offline Offline
21,961 posts
since Aug 2005
Jun 24th, 2007
0

Re: linker problem 2

hmm...you are right...
Reputation Points: 27
Solved Threads: 2
Posting Whiz in Training
jan1024188 is offline Offline
254 posts
since Aug 2006

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in C++ Forum Timeline: LValue Required
Next Thread in C++ Forum Timeline: install library how to??





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC