头文件重引用的问题
编译Debug正常,但编译Release时出错
msvcprt.lib(MSVCP71.dll) : error LNK2005: "public: __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (??0?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@ABV01@@Z) already defined in P2Ppublic.lib(B2.obj)
//主程序
WinMain()
#include <A1.h>
//...//
A1.h
#ifndef A1
#define A1
#include <B2.h>
#include <string>
using namespace std;
//...//
#endif
B2.h
#ifndef B2
#define B2
#include <A1.h>
#include <string>
using namespace std;
//...//
#endif
是
#include <string>
using namespace std;
引起的,但不知如何解决?