Jump to content
  • Advertisement
Sign in to follow this  

std::ofstream link error?

This topic is 5396 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 get that error if I try to do: std::ofstream stream("bla.log"); It works in DevC++. Why not in VC++? §: Thank you! D: ( VC++ 2002 with the compiler/linker/headers from the VC++ 2003 Toolkit ) Error:
logfiletest error LNK2019: unresolved external symbol
"struct _iobuf * __cdecl std::_Fiopen(char const *,int,int)" (?_Fiopen@std@@YAPAU_iobuf@@PBDHH@Z) referenced in function 
"public: class std::basic_filebuf<char,struct std::char_traits<char> > * __thiscall 
std::basic_filebuf<char,struct std::char_traits<char> >::open(char const *,int,int)" 

 #include <string>
 #include <fstream>
 #include <iostream>
 #include <ios>

   class Logfile
		   std::ofstream stream;
		   const std::string filename;
		   Logfile( const Logfile& ){}
		   Logfile& operator= ( const Logfile& ){}
		   Logfile( const char* filename_ )
		     :filename(filename_), stream( filename_ )


[Edited by - rakoon2 on October 11, 2004 1:11:06 PM]

Share this post

Link to post
Share on other sites
Original post by rakoon2
( VC++ 2002 with the compiler/header/headers from the VC++ 2003 Toolkit )

That is probably the problem.
You need to link with the correct (VC++ .NET 2003) libraries.

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!