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

}

Then error LNK2005: "public: void __thiscall" will appear when compiling. When deleting the constructor and destructor, it can pass? Why? What should I do if I still can't compile the runtime library by changing the runtime library as mentioned on the Internet? ?

巴扎黑
巴扎黑

reply all(1)
伊谢尔伦

Have you posted the complete code? I am running it normally in vs2015.


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

using namespace std;

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

private:

};

A::A()
{
}

A::~A()
{
}

int main() 
{
    
    

    return 0;
}
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!