Forgive me if this question doesnt make sense or if it may seem to easy but i am trying to understand how these header files
Is it possbile to declare inside of a header file variables with types like int and so on?
I have the following code and there is a problem with the lines where i declare window and the dimensions of the window.The compiler says there is a multiple definition of them being first defined in the main file where i simply have #include "core.h" and being defined again in the core.cpp where i again have a #include "core.h".
#ifndef SFMLAPP_CORE_H
#define SFMLAPP_CORE_H
#include "SFML/Graphics.hpp"
#include <iostream>
sf::RenderWindow* window;///Window
float ScreenW,ScreenH;///Dimensions of the window
struct position ///used in position handiling
{
float x=-1;
float y=-1;
};
void printText(position pos,std::string Text,float size,float outlineSize);
#endif //SFMLAPP_CORE_H