Class : unresolved external symbol error.

Hello, I am receiving unresolved external symbol error while working with 3 seperate files : main.cpp, class.h, and class.cpp.
Main:

1
2
3
4
5
6
7
8
9
#include <iostream>
#include "Grum.h"
using namespace std;

int main()
{
    Grum gru;
      return 0;
}


Class header:

1
2
3
4
5
6
7
8
9
10
11
#ifndef GRUM_H
#define GRUM_H


class Grum
{
    public:
         Grum();
};

#endif // GRUM_H 


Grum.cpp:

1
2
3
4
5
6
7
#include <iostream>
#include "grum.h"
using namespace std;
Grum::Grum()
{
    cout << "grum" << endl;
}


Could I please know where did I make a mistake and how to fix it ? Thank you.
Last edited on
It's in the Grum.cpp File. Look at the include.

#include "grum.h"

Should be a big g right? #include "Grum.h"
Ensure you are compiling Grum.cpp and linking the resultant object code.

If you're using an IDE, make sure Grum.cpp is a part of the project. If you're using the command line, make sure it is correct and you enumerate Grum.cpp as one of the files to be compiled/linked.


Should be a big g right?

If that were the problem it wouldn't have got to the linking stage.
Oh, yes, im using CodeBlocks IDE and my Grum.cpp wasnt part of the project. I put it in the project now and I seem to be getting even more unresolved external errors. All of their file names seems to be starting with lib and the last one being the directory of project.exe
Topic archived. No new replies allowed.