vc++ 工程包含其他工程的头文件问题
各位大牛问个基础问题,小弟刚接触VS,前期都在linux环境编译C++
问下VC++中在假设在MyDemo工程中包含了工程MyDemo_I中的头文件,MyDemo_I中的头文件声明了类和在.cpp文件中定义了该类,MyDemo工程的main函数使用了MyDemo_I的类,为了保证MyDemo工程能正常编译过,要改什么配置?PS:单个文件能编译成功。
错误信息如下:
1>MyDemo.obj : error LNK2019: 无法解析的外部符号 "class std::basic_ostream<char,struct std::char_traits<char> > & __cdecl Operator::operator<<(class std::basic_ostream<char,struct std::char_traits<char> > &,class Operator::COperator const &)" (??6Operator@@YAAAV?$basic_ostream@DU?$char_traits@D@std@@@std@@AAV12@ABVCOperator@0@@Z),该符号在函数 __catch$_main$0 中被引用
1>MyDemo.obj : error LNK2019: 无法解析的外部符号 "public: class Operator::COperator & __thiscall Operator::COperator::operator+(int)" (??HCOperator@Operator@@QAEAAV01@H@Z),该符号在函数 __catch$_main$0 中被引用
1>MyDemo.obj : error LNK2019: 无法解析的外部符号 "public: __thiscall Operator::COperator::COperator(int,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (??0COperator@Operator@@QAE@HABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z),该符号在函数 __catch$_main$0 中被引用
1>D:\work\myDemo\Debug\myDemo.exe : fatal error LNK1120: 3 个无法解析的外部命令