c++ - 老問題error LNK2005: "public: void __thiscall
巴扎黑
巴扎黑 2017-06-24 09:43:00
0
1
868
// 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(){

}

然後編譯就會出現error LNK2005: "public: void __thiscall問題,當刪除構造和析構函數可以通過?為什麼呢?還有我通過網上說的更改運行時庫還是不能編譯通過,怎麼辦? ?

巴扎黑
巴扎黑

全部回覆(1)
伊谢尔伦

程式碼有沒有貼全,我在vs2015運作正常。


#include <iostream>
#include <vector>
#include <iterator>

using namespace std;

class A
{
public:
    A();
    ~A();

private:

};

A::A()
{
}

A::~A()
{
}

int main() 
{
    
    

    return 0;
}
熱門教學
更多>
最新下載
更多>
網站特效
網站源碼
網站素材
前端模板
關於我們 免責聲明 Sitemap
PHP中文網:公益線上PHP培訓,幫助PHP學習者快速成長!