|
VC6.0下,按照CPPUnit提供的examples测试一个小的程序,build时有如下提示:
CompareTest.obj : error LNK2001: unresolved external symbol "public: virtual __thiscall CppUnit::SourceLine::~SourceLine(void)" ([email=??1SourceLine@CppUnit@@UAE@XZ]??1SourceLine@CppUnit@@UAE@XZ[/email])
CompareTest.obj : error LNK2001: unresolved external symbol "public: static void __cdecl CppUnit::Asserter::failIf(bool,class CppUnit::Message const &,class CppUnit::SourceLine const &)" ([email=?failIf@Asserter@CppUnit@@SAX_NABVMessage@2@ABVSourceLine@2@@Z]?failIf@Asserter@CppUnit@@SAX_NABVMessage@2@ABVSourceLine@2@@Z[/email])
CompareTest.obj : error LNK2001: unresolved external symbol "public: __thiscall CppUnit::Message::Message(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,class std::basic_string<char,struct std::char_t
raits<char>,class std::allocator<char> > const &)" ([email=??0Message@CppUnit@@QAE@ABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@0@Z]??0Message@CppUnit@@QAE@ABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@0@Z[/email])
……
……
(共35条,余略)
仔细和examples中最简单的simple比对后,发现在simple工程下还有一个Makefile.am文件。尝试把simple中的.CPP、.h单独取出重新build时也出现了N多条error LNK2001的提示。
请问:
1、Makefile.am有什么用?我的粗浅理解是:makefile是用来告诉编译器如何进行编译的,在UNIX中用make编译时会用到该文件。在VC下也需要吗?
2、出现以上的问题是不是就是因为VC无法链接到CPPUnit提供的类?该如何解决呢? |
|