Skip to main content
GameDev.net gamedev.net
🔒 Locked

Windows Compiling Problem

Started by Peon Sep 24, 2000 at 12:42 AM 4 replies 300+ views
Original Post
Peon
Peon
Well, I finally pick up TOTWPG and it looks great Anyway, I go to compile the first example, by: 1) Creating a new Win32 Application 2) Using the wizard, selecting the second option, a "Simple win32 Application" 3) Then adding the following source code, straight from the CD
    
// DEMO2_2.CPP - a simple message box

#define WIN32_LEAN_AND_MEAN 

#include <windows.h>        // the main windows headers 
#include <windowsx.h>       // a lot of cool macros


// main entry point for all windows programs

int WINAPI WinMain(HINSTANCE hinstance,
			       HINSTANCE hprevinstance,
			       LPSTR lpcmdline,
			       int ncmdshow)
{
// call message box api with NULL for parent window handle

MessageBox(NULL, "THERE CAN BE ONLY ONE!!!",
                 "MY FIRST WINDOWS PROGRAM",
                  MB_OK | MB_ICONEXCLAMATION);

// exit program

return(0);

} // end WinMain

    
I SHOULD get a message box from compiling, instead I get this message: "--------------------Configuration: Peon3 - Win32 Debug-------------------- Compiling... demo2_2.cpp c:\program files\microsoft visual studio\21days\peon3\demo2_2.cpp(22) : fatal error C1010: unexpected end of file while looking for precompiled header directive Error executing cl.exe. Peon3.exe - 1 error(s), 0 warning(s)" Wanting to figure the problem out myself, I check the C++ Help file and get this:
quote:
Fatal Error C1010 unexpected end of file while looking for precompiled header directive A precompiled header was specified, but it did not contain a precompiled header directive. This error can be caused by specifying an incorrect file as a header file, or by specifying an include file with the /Yu (Use Precompiled Header) command line option that is not listed in the source file as an include file.
Sorry, but at my level, that doesn''t tell me a whole lot Any suggestions, anyone? thanks Peon
Peon
Shannon Barber
Shannon Barber
You picked the wrong project type, it thinks it needs a include "stdafx.h"

Make a new workspace, chose Win32 application, and chose empty project (not a simple one).
The trade-off between price and quality does not exist in Japan. Rather, the idea that high quality brings on cost reduction is widely accepted.-- Tajima & Matsubara
Shannon Barber
Shannon Barber
I have that book too it''s pretty good to get you rolling.
Though I can''t wait for the volume 2 (the 3D stuff), course by the time it comes out I may already know all the stuff Tony will cover.
The trade-off between price and quality does not exist in Japan. Rather, the idea that high quality brings on cost reduction is widely accepted.-- Tajima & Matsubara
Peon
Peon
THANK GOD FOR GAMEDEV! I WOULD BE SO LOST WITHOUT YA GUYS!

Thanks soooo much, Magmai Kai Holmlor, I''ll remember you when I start writing my Quake clone tomorrow

That did the trick alright

Thanks

Peon
Peon
Shannon Barber
Shannon Barber
I mucked around for weeks on that one before I recongize it now.
The trade-off between price and quality does not exist in Japan. Rather, the idea that high quality brings on cost reduction is widely accepted.-- Tajima & Matsubara
Cygon
Cygon
You may as well use a ''Simple Win32 application'', just make sure you don''t have two WinMain()s. Thought there''s no advantage in doing that, just for you to know what to do when getting that error:

Under ''Project Settings'' (Alt-F7)
Tab ''C/C++''
Category ''Precompiled Headers''
Select ''Automatically use precompiled headers'' instead of ''Use file of precompiled headers (.PCH)''

If there''s a file listed after ''Through header:'', you can cut&paste that to the Box below ''Automatically use...''

But there''s nothing wrong doing it the other way, precompiled headers are just there to speed up compiling in very large projects.

-Markus-
Professional C++ and .NET developer trying to break into indie game development.
Follow my progress: http://blog.nuclex-games.com/ or Twitter - Topics: Ogre3D, Blender, game architecture tips & code snippets.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.