Before I had #define SFML_STATIC in the main.cpp file before compiling (and figuring out that you had to add each cpp file to the command else things wouldn't link properly, which is irrelevant) and I would get an error where RenderWindow wouldn't work. Yet, I defined the SFML_STATIC definition before including my header file right. So when I remove it from the main cpp file to the header file everything magically works again? Why is this?
Is it because the SFML/Graphic.hpp etc.. files need to know about this constant before proceeding directly in the file itself before the header include?
(ps: disregard the include file names and what not they are irrelevant to teh question)
main.cpp
/**
* Game Instance
* @Author: Lamonte & Jordan
* @Copyright: 2013-
*/
#include "t_game.h"
int main() {
G_Instance game;
return 0;
}
g_instance.h
#ifndef GAME_CORE_H
#define GAME_CORE_H
#define SFML_STATIC
#include <SFML/Graphics.hpp>
class G_Instance {
sf::RenderWindow window;
public:
G_Instance();
};
#endif
g_instance.cpp
#include "t_game.h"
G_Instance::G_Instance() {
window.create(sf::VideoMode(200,200), "Works");
}