I have a problem in CodeBlocks when I create a new Class folder, some folders are missing. When I run the program it says:
1- undefined reference to `bruh::bruh(int, int)'|
2- undefined reference to `bruh::print()'|
and here's how the files look like:
The main.cpp file:
#include <iostream>
#include "bruh.h"
using namespace std;
int main()
{
bruh object(1,2);
object.print();
}
The Header file bruh. (it's supposed to be bruh.h, here's the problem):
#ifndef BRUH_H
#define BRUH_H
class bruh
{
public:
bruh(int a, int b);
void print();
private:
int Regular();
int Constant();
};
#endif // BRUH_H
In the source file bruh. (it's supposed to be bruh.cpp, here's another problem)
#include <iostream>
#include "bruh.h"
using namespace std;
bruh::bruh(int a, int b)
:Regular(a), Constant(b)
{
//ctor
}
void bruh::print(){
cout << "Regular" << Regular << endl:
cout << "Constant" << Constant << endl;
}
When creating the Class I uncheck the "Has Destructor" option, and check the "Add paths to project" and "Header and implementation file should be in the same folder" options.
I realized that there's no .h and .cpp where there should be. Any solutions?