Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

C++, Help please 1

Status
Not open for further replies.

Gmama

IS-IT--Management
Mar 31, 2004
13
US
Deleting intermediate files and output files for project 'DELETE - Win32 Debug'.
--------------------Configuration: DELETE - Win32 Debug--------------------
Compiling...
DELETE.CPP
Linking...
LIBCD.lib(crt0.obj) : error LNK2001: unresolved external symbol _main
Debug/DELETE.exe : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.

DELETE.exe - 2 error(s), 0 warning(s)
 
It looks like you made a console app. Console apps need a main() function, which is where execution begins. If you wanted a win32 app with WinMain(), create a new project and try Win32 Application rather than win32 console app.
 
Deleting intermediate files and output files for project 'dateX - Win32 Debug'.
--------------------Configuration: dateX - Win32 Debug--------------------
Compiling...
StdAfx.cpp
Compiling...
dateX.cpp
dateXone.cpp
c:\~class folder\c++\midterm\datex\datexone.cpp(547) : fatal error C1010: unexpected end of file while looking for precompiled header directive
Generating Code...
Error executing cl.exe.

dateX.exe - 1 error(s), 0 warning(s)


Help please!
 
You usually get that when you don't #include "stdafx.h" and you need to. I don't know what the point of a precompiled header is, personally (does anyone else?) but you need one if your project was created with one, which yours apparently was. At the top of every source file you'll need to #include "stdafx.h".
 
Attached the #include but I guess I needed to put it at the very top. Thank you again for your help. I can't thank you enough Timmay.

 
You can also switch off the need for pre-compiled headers in your project settings. That will allow you to not include that stdafx.h


Skute

"There are 10 types of people in this World, those that understand binary, and those that don't!"
 
It remembers me something that can be fixed by changing the Project Properties/C/C++/Code Generation/Use run-time library....

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top