【发布时间】:2012-10-08 12:10:56
【问题描述】:
我在 DLL(它使用 /clr 运行时,ManagedC++)中创建了一个类,并在该类中定义了一个构造函数。代码如下:
//Following is defined in something.h//
namespace ABC
{
public ref Class XYZ
{
public: int a;
public: XYZ();
};
//In something.cpp, I've the below code to define the constructor of the class created//
#include something.h
namespace ABC
{
XYZ::XYZ()
{
a = 100;
}
}
上面的项目是内置到DLL中的
在另一个项目中,我尝试使用 XYZ 类,如下所示:
#include something.h
using namespace ABC;
//inside main, I've following code
{
ABC::XYZ^ prq = gcnew ABC:XYZ();
prq->a=200;
......
...
}
在此,我收到一条错误消息 -
unresolved token (06000001) ABC.XYZ::.ctor
您能帮忙解决一下这里的问题吗?
【问题讨论】:
标签: dll managed-c++