Hey guys im working on my 2d game in visual express c++ with dark gdk and im having a problem.
Now basically before i got dark gdk, i had a go at making a command line based game, you know along the lines of press 1 and enter to go here, 2 and enter to there, etc. So when i started using dark GDK to have a go at making a 2d game i decided to reuse some of the files from my console based game. When i added player.h into my dark gdk project and tried to compile i got the following errors:
1>libcpmtd.lib(xdebug.obj) : warning LNK4098: defaultlib 'libcmt.lib' conflicts with use of other libs; use /NODEFAULTLIB:library
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)
So i decided the best way to figure out what was causing the error was to comment out certain lines of code, see what happened, turns out that when i commented out the line of code #include <string> and commented out the functions that use strings, it compiled successfully. So does that mean we can't have strings in dark gdk games or am i using incorrect settings etc.
Heres the .h file code
#ifndef player_h
#define player_h
#include <string>
//using namespace std;
class player
{
public:
player();
//void setName(string);
//string getName();
void setPlayerX(int);
void setPlayerY(int);
int getPlayerX();
int getPlayerY();
void setOldPlayerX(int);
void setOldPlayerY(int);
int getOldPlayerX();
int getOldPlayerY();
private:
//string name;
int PlayerX;
int PlayerY;
int oldPlayerX;
int oldPlayerY;
};
#endif
Thanks in advance