943,940 Members | Top Members by Rank

Ad:
  • C++ Discussion Thread
  • Unsolved
  • Views: 5303
  • C++ RSS
Jul 3rd, 2005
0

Linking Error

Expand Post »
i am programming in Microsoft Visual c++ 6.0 and I have two linking
errors that I do not know what they mean. Can someone please help.

Linking...
LIBCD.lib(wincrt0.obj) : error LNK2001: unresolved external symbol _WinMain@16
Debug/Programming Project 1.exe : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
somer2412 is offline Offline
6 posts
since Oct 2004
Jul 3rd, 2005
0

Re: Linking Error

It means you're using the wrong project type. You created a Win32 application (which requires WinMain instead of main) and then treated it as if it were a console application (by using main instead of WinMain).
Administrator
Reputation Points: 6442
Solved Threads: 1393
Bad Cop
Narue is offline Offline
11,807 posts
since Sep 2004
Jul 7th, 2005
0

Re: Linking Error

just replace your int main(void) function with :
C++ Syntax (Toggle Plain Text)
  1. int WINAPI WinMain(
  2.  
  3. HINSTANCE hInstance,
  4. HINSTANCE hPrevInstance,
  5. LPSTR lpCmdLine,
  6. int nCmdShow
  7. )
Reputation Points: 11
Solved Threads: 6
Junior Poster
CrazyDieter is offline Offline
106 posts
since Jul 2005
Jul 7th, 2005
0

Re: Linking Error

Quote originally posted by CrazyDieter ...
just replace your int main(void) function with :
C++ Syntax (Toggle Plain Text)
  1. int WINAPI WinMain(
  2.  
  3. HINSTANCE hInstance,
  4. HINSTANCE hPrevInstance,
  5. LPSTR lpCmdLine,
  6. int nCmdShow
  7. )
Brilliant! Destroy portability because you're too lazy to delete the project and try again. Since it's not obvious whether the OP wants portable C++ or Win32 C++, a better suggestion would be to create a new project that doesn't expect platform specific code to compile.
Administrator
Reputation Points: 6442
Solved Threads: 1393
Bad Cop
Narue is offline Offline
11,807 posts
since Sep 2004
Jul 8th, 2005
0

Re: Linking Error

I love you.
Reputation Points: 11
Solved Threads: 6
Junior Poster
CrazyDieter is offline Offline
106 posts
since Jul 2005

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: please someone help me urgent
Next Thread in C++ Forum Timeline: Can't execute exe "BCBSMP50.BPL was not found"





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


Follow us on Twitter


© 2011 DaniWeb® LLC