一个问题,请帮忙
extern "C"
{
class __declspec(dllexport)test
{
public:
int x;
int y;
test();
~test();
void wtest(int z);
private :
void do_wtest(int w);
};
}这是在vc中用的头文件
extern "C"
{
test::test(){x=0;y=0;};
test::~test(){};
void test::wtest(int z)
{
do_wtest(z);
};
void test::do_wtest(int w)
{
x=w;
};
}这是在vc中用的源文件,在vc中生成wdll.dll
extern "C"
{
class __declspec(dllimport) test
{
public:
int x;
int y;
test();
~test();
void wtest(int z);
private :
void do_wtest(int w);
};
}这是在bcb中用的头文件
#include <vcl.h>
#pragma hdrstop
#include "wdll.h"
#include "Unit1.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TForm1 *Form1;
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
: TForm(Owner)
{
}
void __fastcall TForm1::Button1Click(TObject *Sender)
{
test td;
td.wtest(34);
}这是BCB的源文件
这是在BCB中用静态调用VC产生的DLL
出错位
[Linker Error] Unresolved external 'test::~test()' referenced from H:\VC\WDLL\UNIT1.OBJ
[Linker Error] Unresolved external 'test::test()' referenced from H:\VC\WDLL\UNIT1.OBJ
[Linker Error] Unresolved external 'test::wtest(int)' referenced from H:\VC\WDLL\UNIT1.OBJ
所需的WDLL.LIB 我也手工生成
请大家帮忙