Why do I get a multiple definition error while linking?
问题 I use these two files here and here. I created a class in two separate files: modul1.h #ifndef MODUL1_H #define MODUL1_H #include <iostream> #include <fstream> #include "easylogger.h" class Modul1 { public: Modul1(std::string name); protected: private: easylogger::Logger *log; }; #endif // MODUL1_H and modul1.cpp #include "modul1.h" Modul1::Modul1(std::string name):log(new easylogger::Logger(name)) { //ctor //std::ofstream *f = new std::ofstream(name.c_str(), std::ios_base::app); //log-