Hi, I have just started using SFML and encountered that the following will not work globally, but does work if I put it in my main() function (I am using C++):
sf::Texture texture;
texture.loadFromFile(image);
I will get the following exceptions for the "loadFromFile()" function line:
error C2143: syntax error : missing ';' before '.'
error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
error C2371: 'texture' : redefinition; different basic types
The following is an exception for the Texture declaration line:
see declaration of 'texture'
Also, when placed globally, "texture" is underlined with a red squiggly line as if incorrect. (I am using VS 2013)
Any help would be greatly appreciated!