我有有兩個重載函數的類。我如何從dll中導出它,以及如何由其他C++類使用它?我的階級是這樣的:如何從dll導出C++類?
#define DECLDIREXP __declspec(dllexport)
#define DECLDIRIMP __declspec(dllimport)
class DECLDIREXP xyz
{
public:
void printing();
void printing(int a);
};
using namespace std;
void xyz::printing()
{
cout<<"hello i donot take any argument";
}
void xyz::printing(int a)
{
cout<<"hello i take "<< a <<"as argument";
}
令我驚訝的是,我沒有找到這個重複的現有問題。我會認爲這是一個相當普遍的問題。 –
檢查:http://stackoverflow.com/questions/6620791/exporting-classes-to-dlls – Ajay