K
kathy
I have posted my problem before and still not feel confused. Anyone
know what is the problem?
In my Win32 dll, I defined:
#ifdef DllExport
#define UNMANAGED_API __declspec(dllexport)
#else
#define UNMANAGED_API __declspec(dllimport)
#endif
#ifdef __cplusplus
extern "C" {
#endif
struct UNMANAGED_API MyData
{
int data1;
int data2;
};
class UNMANAGED_API BubbleSort
{
private:
int *data;
int length;
public:
WINAPI BubbleSort(int *d, int l);
void WINAPI sort();
};
#ifdef __cplusplus
}
#endif
In my mixed mode VC++.NET class library:
public __gc class ManagedBubbleSort
{
// TODO: Add your methods for this class here.
private:
BubbleSort *pBSort;
public:
ManagedBubbleSort(int d __gc[], int l)
{
int *data;
int i;
data = new int[l];
for(i=0;i<l;i++)
data=d;
pBSort = new BubbleSort(data,l);
}
void managedBSort(){pBSort->sort();}
};
When I built my Class lib, I got:
"MyClassLib error LNK2001: unresolved external symbol "public: void
__thiscall BubbleSort::sort(void)" (?sort@BubbleSort@@$$FQAEXXZ)"
know what is the problem?
In my Win32 dll, I defined:
#ifdef DllExport
#define UNMANAGED_API __declspec(dllexport)
#else
#define UNMANAGED_API __declspec(dllimport)
#endif
#ifdef __cplusplus
extern "C" {
#endif
struct UNMANAGED_API MyData
{
int data1;
int data2;
};
class UNMANAGED_API BubbleSort
{
private:
int *data;
int length;
public:
WINAPI BubbleSort(int *d, int l);
void WINAPI sort();
};
#ifdef __cplusplus
}
#endif
In my mixed mode VC++.NET class library:
public __gc class ManagedBubbleSort
{
// TODO: Add your methods for this class here.
private:
BubbleSort *pBSort;
public:
ManagedBubbleSort(int d __gc[], int l)
{
int *data;
int i;
data = new int[l];
for(i=0;i<l;i++)
data=d;
pBSort = new BubbleSort(data,l);
}
void managedBSort(){pBSort->sort();}
};
When I built my Class lib, I got:
"MyClassLib error LNK2001: unresolved external symbol "public: void
__thiscall BubbleSort::sort(void)" (?sort@BubbleSort@@$$FQAEXXZ)"