Linking Error

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

Join Date: Oct 2004
Posts: 6
Reputation: somer2412 is an unknown quantity at this point 
Solved Threads: 0
somer2412 somer2412 is offline Offline
Newbie Poster

Linking Error

 
0
  #1
Jul 3rd, 2005
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.
Reply With Quote Quick reply to this message  
Join Date: Sep 2004
Posts: 7,599
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: 712
Team Colleague
Narue's Avatar
Narue Narue is offline Offline
Code Goddess

Re: Linking Error

 
0
  #2
Jul 3rd, 2005
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).
I'm here to prove you wrong.
Reply With Quote Quick reply to this message  
Join Date: Jul 2005
Posts: 76
Reputation: CrazyDieter is an unknown quantity at this point 
Solved Threads: 3
CrazyDieter's Avatar
CrazyDieter CrazyDieter is offline Offline
Junior Poster in Training

Re: Linking Error

 
0
  #3
Jul 7th, 2005
just replace your int main(void) function with :
  1. int WINAPI WinMain(
  2.  
  3. HINSTANCE hInstance,
  4. HINSTANCE hPrevInstance,
  5. LPSTR lpCmdLine,
  6. int nCmdShow
  7. )
Reply With Quote Quick reply to this message  
Join Date: Sep 2004
Posts: 7,599
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: 712
Team Colleague
Narue's Avatar
Narue Narue is offline Offline
Code Goddess

Re: Linking Error

 
0
  #4
Jul 7th, 2005
Originally Posted by CrazyDieter
just replace your int main(void) function with :
  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.
I'm here to prove you wrong.
Reply With Quote Quick reply to this message  
Join Date: Jul 2005
Posts: 76
Reputation: CrazyDieter is an unknown quantity at this point 
Solved Threads: 3
CrazyDieter's Avatar
CrazyDieter CrazyDieter is offline Offline
Junior Poster in Training

Re: Linking Error

 
0
  #5
Jul 8th, 2005
I love you.
Reply With Quote Quick reply to this message  
Reply

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


Thread Tools Search this Thread



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

©2003 - 2009 DaniWeb® LLC