I commented out all my code to verify it was just the #includes causing the problem.
I have 3 files.
Main.cpp
MG_Gamestate.h
MG_Gamestate.cpp
The idea being that the important variables about starting my game will be included in the Gamestate class, which I define in MG_Gamestate and code in MG_Gamestate.cpp.
This is pretty standard stuff, I'm mostly just messing around.
At this point, after commenting out the code, Main.cpp contains only the following:
#include "DarkGDK.h"
#include "MG_Gamestate.h"
void DarkGDK(void)
{
}
MG_Gamestate.h contains only the following:
#include "DarkGDK.h"
#ifndef _MG_GAMESTATE_H_
#define _MG_GAMESTATE_H_
//class stuff
#endif
and MG_Gamestate.cpp contains the following:
#include "DarkGDK.h"
#include "MG_Gamestate.h"
That is IT. It is a completely blank program that does absolutely nothing.
But somehow the includes are messing it up. I figure it's trying to include something twice and getting confused, but I'm not sure what or where.
here is the error code:
------ Build started: Project: Dark GDK - 3D Game1, Configuration: Debug Win32 ------
Compiling...
MG_Gamestate.cpp
Compiling...
Main.cpp
Linking...
LINK : Debug\Dark GDK - 3D Game1.exe not found or not built by the last incremental link; performing full link
LINK : warning LNK4098: defaultlib 'LIBCMT' conflicts with use of other libs; use /NODEFAULTLIB:library
libcpmtd.lib(xdebug.obj) : error LNK2019: unresolved external symbol __malloc_dbg referenced in function "void * __cdecl operator new(unsigned int,struct std::_DebugHeapTag_t const &,char *,int)" (??2@YAPAXIABU_DebugHeapTag_t@std@@PADH@Z)
libcpmtd.lib(xdebug.obj) : error LNK2019: unresolved external symbol __free_dbg referenced in function "void __cdecl operator delete(void *,struct std::_DebugHeapTag_t const &,char *,int)" (??3@YAXPAXABU_DebugHeapTag_t@std@@PADH@Z)
libcpmtd.lib(stdthrow.obj) : error LNK2019: unresolved external symbol __CrtDbgReportW referenced in function "void __cdecl std::_Debug_message(wchar_t const *,wchar_t const *,unsigned int)" (?_Debug_message@std@@YAXPB_W0I@Z)
Debug\Dark GDK - 3D Game1.exe : fatal error LNK1120: 3 unresolved externals
Build log was saved at "file://c:\Users\Spielman\Documents\Visual Studio 2008\Projects\Dark GDK - 3D Game1\Dark GDK - 3D Game1\Debug\BuildLog.htm"
Dark GDK - 3D Game1 - 4 error(s), 1 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
Why isn't this working?
I'm running Visual C++ 2008 Express on Windows 7.