I have a main class in which Im trying to call on a function to create the menu but I keep getting this error:
error LNK2019: unresolved external symbol “public: static int __cdecl Controller::menu(void)” (?menu@Controller@@SAHXZ) referenced in function _main
This is my main class.
#include "Main.h"
using namespace std;
int main ()
{
Control:: menu();
return 0;
}
this is the Main.h
#pragma once
#include "Control.h"
class Main:
{
public:
Main(void);
~Main(void);
int main();
};
the Control.h:
#pragma once
#include <iostream>
class Control
{
public:
Control(void);
~Control(void);
static int menu ();
};
and finally the control cpp file:
#include "Control.h"
using namespace std;
static int menu ()
{
bunch of menu code
return 0;
}
I think it’s something simple but I just cant figure it out. I tried removing static as well as changing the function to a void function, but neither worked.
should be
That’s the proper way of defining members.