//main.cpp
#include <iostream>
#include "Test.h"
using namespace std;
int main() {
Test t;
return 0;
}
//Test.h
#ifndef TEST_TEST_H
#define TEST_TEST_H
class Test {
public:
Test();
};
#endif //TEST_TEST_H
//Test.cpp
#include "Test.h"
#include <iostream>
using namespace std;
Test::Test() {
cout << "It worked";
}
I just started using C++ and I cannot figure out why this is not compiling. I am using the mingw compiler and CLion if that makes a difference with the error, I don't see why it would but I am being told that I need more detail...
Error message
C:\Users\Jason\AppData\Local\Temp\ccQ7aCrg.o:main.cpp:(.text+0x15): undefined reference to `Test::Test()'
collect2.exe: error: ld returned 1 exit status