// A.cpp
#include "A.h"
// A.h
#ifndef _A_H
#define _A_H
class A
{
public:
A();
~A();
private:
};
A::A()
{
}
A::~A()
{
}
#endif
// test.cpp
#include "A.h"
int main(){
}
然後編譯就會(huì)出現(xiàn)error LNK2005: "public: void __thiscall問(wèn)題,當(dāng)刪除構(gòu)造和析構(gòu)函數(shù)可以通過(guò)?為什麼呢?還有我通過(guò)網(wǎng)上說(shuō)的更改運(yùn)行時(shí)庫(kù)還是不能編譯通過(guò),怎麼辦? ?
程式碼有沒(méi)有貼全,我在vs2015運(yùn)作正常。
#include <iostream>
#include <vector>
#include <iterator>
using namespace std;
class A
{
public:
A();
~A();
private:
};
A::A()
{
}
A::~A()
{
}
int main()
{
return 0;
}