Undefined reference to "variable"

Question:
I messed my code up somewhere but cannot find what’s wrong. I changed the structure of my files and now I am getting lots of errors similar to these:
/home/runner/GLiTCH/4functions.cpp:618: undefined reference to `itemcost' /nix/store/039g378vc3pc3dvi9dzdlrd0i4q93qwf-binutils-2.39/bin/ld: /home/runner/GLiTCH/4functions.cpp:623: undefined reference to `shop_have'
all the errors seem to be entirely based around the file named 4functions.cpp
(Really don’t like having to go to the community twice in one week)
Repl link:
https://replit.com/@NathanialGomez/GLiTCH

Where is the definitions for the itemcost and shop_have variables?
You declared them asextern in variables.h but I still don’t see their definitions in any of the .cpp files?

1 Like

Sorry, I meant to leave a comment on this with what the solution was for others.
I ended up finding that where I meant to declare the variables they were still set as extern variables.

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.