Heim  >  Fragen und Antworten  >  Hauptteil

c++ – alter Problemfehler LNK2005: „public: void __thiscall

// 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(){

}

Dann erscheint beim Kompilieren der Fehler LNK2005: „public: void __thiscall“. Warum habe ich die Laufzeitbibliothek wie im Internet erwähnt geändert? Das tue ich??

巴扎黑巴扎黑2646 Tage vor874

Antworte allen(1)Ich werde antworten

  • 伊谢尔伦

    伊谢尔伦2017-06-24 09:45:00

    代码有没有贴全,我在vs2015运行正常。

    
    #include <iostream>
    #include <vector>
    #include <iterator>
    
    using namespace std;
    
    class A
    {
    public:
        A();
        ~A();
    
    private:
    
    };
    
    A::A()
    {
    }
    
    A::~A()
    {
    }
    
    int main() 
    {
        
        
    
        return 0;
    }

    Antwort
    0
  • StornierenAntwort