0

I am somewhat of a beginner in VS code so I was not able to tackle this issue, I've been getting this error message:

C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\Users\PC\AppData\Local\Temp\ccqslk0i.o:main.cpp:(.text+0x20): undefined reference to `test::test(int, int)'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\Users\PC\AppData\Local\Temp\ccqslk0i.o:main.cpp:(.text+0x37): undefined reference to `test::set(int, int)'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\Users\PC\AppData\Local\Temp\ccqslk0i.o:main.cpp:(.text+0x43): undefined reference to `test::print() const'

I created this header file header.h:

#include <iostream>

using namespace std;

class test
{
    private:
        int x, y;
    public:
        void set(int, int);
        test(int = 0, int = 0);
        void print()const;
};

and implemented it in an imp.cpp file normally, then I called header.h in the main.cpp, created an object and ran the code using the code runner extension (not sure if this is relevant) and I've been getting this error, please help

Alan Birtles
  • 32,622
  • 4
  • 31
  • 60

0 Answers0