【发布时间】:2014-09-15 13:17:03
【问题描述】:
我在 dll 中有以下类
header
class __declspec(dllexport) MyClass
{
public:
bool fun1(const CString& csFilename, int& nFileID );
bool fun2(int nFileID, int nImageNum, int nStartIndex);
};
cpp
bool MyClass::fun1(const CString& csFilename, int& nFileID )
{
}
bool Myclass::fun2(int nFileID, int nImageNum, int nStartIndex)
{
}
main
void main()
{
MyClass *p = new MyClass;
p->fun1(...); //if I comment this code compiles and builds
p->fun2(...); //this is ok
}
我收到错误 LNK2019: unresolved external symbol "public: bool __thiscall... 只为 fun1 不为 fun2 甚至都在同一个班为什么? 提前致谢。
【问题讨论】:
-
发布实际的函数调用和实际的错误文本。
-
很抱歉无法提供实际代码仍然感谢提示我会检查这个方向。
-
不能提供实际代码是什么意思?您需要做的就是显示您如何调用
fun1,并粘贴编译器输出。我非常怀疑它们是否包含重要的商业机密。 -
感谢您的提示,它有效问题是 CString 我用 std::string 替换了它,一旦我获得更多技术细节,我会回答。