   Compile Order, messing things up.
  I'm trying to compile my directx application in Visual Studio 2008, I have two source files Appmain.cpp (renamed from main.cpp, which I'll explain in a min) and Game.cppWhen I try to compile, the compiler picks Game.cpp first, rather than Appmain which contains WINMAIN and includes all the other files needed, such as directx headers and game.cppAt first I thought it may be that the compiler picks which one to compile first by alphabetical order, it doesn't.So how can I get the compiler to compile Appmain first? Thanks.   
  If the order that your files are compiled in causes an error, you are doing something spectacularly wrong.   ;  Any hints as to what that is? ;)   ;  Given that you haven't posted any errors, then no.   ;  Well, I get these errors:Error1error C2143: syntax error : missing ';' before '*'c:\users\administrator\documents\visual studio 2008\projects\physics sandbox\physics sandbox\game.cpp8Physics SandboxError2error C4430: missing type specifier - int assumed. Note: C++ does not support default-intc:\users\administrator\documents\visual studio 2008\projects\physics sandbox\physics sandbox\game.cpp8Physics SandboxReferring to:LPDIRECT3DDEVICE9* Device;Another words LPDIRECT3DDEVICE9 hasn't been defined, because the includes for directx are in Appmain.cpphere's the compiler output too:1&gt;------ Build started: Project: Physics Sandbox, Configuration: Debug Win32 ------1&gt;Compiling...1&gt;Game.cpp1&gt;c:\users\administrator\documents\visual studio 2008\projects\physics sandbox\physics sandbox\game.cpp(8) : error C2143: syntax error : missing ';' before '*'1&gt;c:\users\administrator\documents\visual studio 2008\projects\physics sandbox\physics sandbox\game.cpp(8) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int1&gt;c:\users\administrator\documents\visual studio 2008\projects\physics sandbox\physics sandbox\game.cpp(8) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int1&gt;c:\users\administrator\documents\visual studio 2008\projects\physics sandbox\physics sandbox\game.cpp(45) : error C2143: syntax error : missing ';' before '*'1&gt;c:\users\administrator\documents\visual studio 2008\projects\physics sandbox\physics sandbox\game.cpp(45) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int1&gt;c:\users\administrator\documents\visual studio 2008\projects\physics sandbox\physics sandbox\game.cpp(45) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int1&gt;Appmain.cpp1&gt;c:\program files\microsoft directx sdk (november 2008)\include\dinput.h: DIRECTINPUT_VERSION undefined. Defaulting to version 0x08001&gt;Generating Code...1&gt;Build log was saved at "file://c:\Users\Administrator\Documents\Visual Studio 2008\Projects\Physics Sandbox\Physics Sandbox\Debug\BuildLog.htm"1&gt;Physics Sandbox - 6 error(s), 0 warning(s)========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========thanks,*edit: The errors stretch the page, put in source tags.   ;  Headers for definitions need to be included in each source file that uses those definitions. It doesn't matter what order they are compiled in; if the source file needs the header, it needs to include it itself.   ;  Oh, thanks. Sorry, transitioning from C#, will take me a month or so to get it down.