Archived

This topic is now archived and is closed to further replies.

Some problem with fstream and DX?

This topic is 5049 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I don't want to come across as another fstream newbie, but I just went to add in some file output for debugging and I get a linker error. my includes:
#include <Windows.h>
#include <mmsystem.h>
#include <d3dx9.h>
#include <dinput.h>
#include <fstream>
//using namespace std; // tried this and also using std:: directly

It compiles fine, but as soon as I put in the line: fstream f; I get a linker error: error LNK2001: unresolved external symbol __malloc_dbg 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) 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) fatal error LNK1120: 2 unresolved externals Am I overlooking something or is this some kind of incompatibility? [edited by - john dowis on February 19, 2004 6:28:51 PM] [edited by - john dowis on February 19, 2004 6:29:53 PM] [edited by - john dowis on February 19, 2004 6:30:47 PM]

Share this post


Link to post
Share on other sites
Well I always use ifstream with DX8. Not exactly your case but.. Perhaps you just forgot to link winmm.lib or a couplpe other libs. Perhaps including <iostream> will also do the trick.
edit: oops interpreted it as html
-CProgrammer

[edited by - CProgrammer on February 20, 2004 2:23:19 AM]

[edited by - CProgrammer on February 20, 2004 2:23:41 AM]

Share this post


Link to post
Share on other sites