I've decided to dive right into playing with code, no real prior coding experience. I'm using SFML to handle all the low-level stuff, and i've been following the tutorials. I've managed to display a window but now i'm trying to modify the code to be used across different files so I can organize the code. I've taken the tutorial examples, and tried to split them into several files:
#include <SFML/Window.hpp>
//Define function prototypes
void InputGet();
Problem is with the variable Running, when it comes to compiling it with GCC it gives me this error:
1 2 3
/tmp/cc8f8e7B.o: In function `InputGet()':
input.cpp:(.text+0x31): undefined reference to `Running'
input.cpp:(.text+0x58): undefined reference to `Running'
I'm unsure how to properly declare the variable so both window.cpp and input.cpp will interact with it. I've tried googling and using the search but i'm not quite sure how to word my question.
stick it in a header file externint variable , declare it in some cpp file int variable = 0; and include that header wherever you need the variable. xD BTW, its not a trivial matter to be doing this...