c++ undefined reference to static variable [duplicate]
问题 This question already has answers here : static variable link error (2 answers) Closed 4 years ago . I have no idea why this code isn't working. All the source files compile but when I try to link them the compiler yells at me with an undefined reference error. Here's the code: main.cpp: #include "SDL/SDL.h" #include "Initilize.cpp" int main(int argc, char* args[]) { //Keeps the program looping bool quit = false; SDL_Event exit; //Initilizes, checks for errors if(Initilize::Start() == -1) {