Right now I am working on my shell implementation, and I developed an easy system for adding new commands.
Basically I have a command structure that contains some information about that specific command, including a function pointer:
Code:
void (*function_pointer)();
Also I have a function that does all the "adding":
Code:
void Command_List_Add_Command(char* name, char* description, void (*function_pointer)());
//Assignment
command_list[command_count].function_pointer = function_pointer;
There is a function that contains all the add calls. //This is the problem
Code:
Command_List_Add_Command("help", "Displays all available commands.", Commands.Help);
So, I keep getting an error saying: "error: invalid use of non-static member function", even if I make it static.
Side note: all the commands are located in a separate C++ file. "
Commands" is an instance/object of "Commands_Class" class.
I tried everything I remembered of, nothing seemed to be okay. I even trying declaring an external "C" virtual function, that did compile but I was getting opcode exceptions, general protection fault exceptions, etc...
I would appreciate any help.