here is my code simple but I keep getting a linker error
#include "DarkGDK.h"
using namespace std;
string OpenFileDialog ( HWND hwnd, LPSTR filter )
{
string file;
char szFile[260];
OPENFILENAME ofn;
ZeroMemory ( &ofn, sizeof ( ofn ) );
ofn.lStructSize = sizeof ( ofn );
ofn.hwndOwner = hwnd;
ofn.lpstrFile = szFile;
ofn.lpstrFile[0] = '\0';
ofn.nMaxFile = sizeof ( szFile );
ofn.lpstrFilter = filter;
ofn.nFilterIndex = 1;
ofn.lpstrFileTitle = NULL;
ofn.nMaxFileTitle = 0;
ofn.lpstrInitialDir = NULL;
ofn.Flags = OFN_PATHMUSTEXIST | OFN_FILEMUSTEXIST;
if ( GetOpenFileName ( &ofn ) )
file = ofn.lpstrFile;
// return file
return file;
}
// the main entry point for the application is this function
void DarkGDK ( void )
{
HWND window;
LPSTR filter;
string filename;
char* fn;
// turn on sync rate and set maximum rate to 60 fps
dbSyncOn ( );
dbSyncRate ( 60 );
filename=OpenFileDialog(window,filter);
sprintf(fn,filename.c_str());
dbText(100,100,fn);
// our main loop
while ( LoopGDK ( ) )
{
// update the screen
dbSync ( );
}
// return back to windows
return;
}
this is the error I get
1>libcpmtd.lib(xdebug.obj) : warning LNK4098: defaultlib 'libcmt.lib' conflicts with use of other libs; use /NODEFAULTLIB:library
1>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)
1>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)
1>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)
1>Debug\testalpha.exe : fatal error LNK1120: 3 unresolved externals
1>Build log was saved at "file://c:\Users\Blue-Star\Documents\test\testalpha\testalpha\Debug\BuildLog.htm"
1>testalpha - 4 error(s), 4 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
any help would be apreciated
and I already looked if my codegeneration setting is on MT not MTD ,and it is set to MT as it should be to work