What problem are you having trying to do that? It should work as you have it.
BTW, you should not be initializing the pointer in a header file. That initialization should be done in a .cpp file. Initializing the pointer in a header file can cause confusion if the header is included in multiple places.
Maybe the function you've called contains the function setGamestate, that says the function setGamestate has not had any code yet.
You defined the function but it seems you haven't written any code for the function setGameState.
gameState.cpp (setGamestate function is here)
gameMenu.cpp (function that requires the gamestate pointer is here)
game.cpp (the pointer gets created here, and the function gets used here)
Inside gamestate.h I define a gamestate class, with a setGameState public function.
Inside gameMenu.h I included gameState.h and I am trying to write a function that changes the gamestate (which uses dynamic memory)'s gamestate.
I took a close look at the paramaters and double checked everything, it's impossible to be a linker error, but what seems to be the problem is this line INSIDE the function that I'm trying to write:
I Found the problem, you were right, I did have the setGamestate function declared properly however for some reason I accidentally erased it, no idea how, but I re-wrote it and mostly everything works as intended.