我在VS2013中收到这个奇怪的链接错误:
1>tracdata.obj : warning LNK4049: locally defined symbol ?is_open@?$basic_fstream@DU?
$char_traits@D@std@@@std@@QBE_NXZ (public: bool __thiscall
std::basic_fstream<char,struct std::char_traits<char> >::is_open(void)const ) imported
我正在调用stream.is_open(),但据我所知,我自己并没有定义它。
我正在使用boost 1.56.0以及标准的MS内置STL库。我正在使用STL流类(不是增强类)。
#pragma once
#include <sys/stdinc.h>
#include <stdio.h>
#include <string>
#include <fstream>
#include <boost/date_time/posix_time/posix_time.hpp>
class SYSCMMN_EXPORT File
{
File( const File& file );
void operator=( const File& );
public:
File();
File( const char* filename, std::ios_base::open_mode mode = std::ios_base::in | std::ios_base::out );
virtual ~File();
const char* Access() const;
const char* GetName() const
{
return filename.c_str();
}
bool isValid() const
{
return fs.is_open();
}
// ... (snipped for brevity)
protected:
std::string filename;
std::fstream fs;
std::ios_base::open_mode mode;
};