SFML community forums
Help => Graphics => Topic started by: sadin97 on September 14, 2017, 10:34:28 pm
-
Exception thrown at 0x7749B2E3 (ntdll.dll) in App.exe: 0xC0000005: Access violation writing location 0x00000004.
At line:
sf::Texture seaTexture;
In file resources.cpp
I also put:
extern sf::Texture seaTexture;
in file resources.h
So... can I do something like this. Im using seaTexture in another file so I tried to put extern to it.
-
You're probably using the wrong DLLs, e.g. outdated DLLs, x64 vs x86 mismatch or DLLs with different runtime libraries. Make sure everything is matching and that you don't have old libraries and keep in mind that VS comes with two kinds of compilers, one for x86 and one for x64, you have to pick the right one.
-
You're probably using the wrong DLLs, e.g. outdated DLLs, x64 vs x86 mismatch or DLLs with different runtime libraries. Make sure everything is matching and that you don't have old libraries and keep in mind that VS comes with two kinds of compilers, one for x86 and one for x64, you have to pick the right one.
Are you sure that is the problem? I can use generally sf::Texture... but with this making it extern I got problems.
-
Some SFML resources can't be declared in the global scope. They do internal stuff during their construction and destruction, which involves other global variables that may not be available due to non-deterministic order of initialization of globals.
-
Some SFML resources can't be declared in the global scope. They do internal stuff during their construction and destruction, which involves other global variables that may not be available due to non-deterministic order of initialization of globals.
So... any hint? How should I use same texture in other file if it is even possible?
-
Pass by reference.
-
Pass by reference.
Can you post some simple examples using textures?
-
A reference works the same way for any type. If you don't know how a reference works, you should go back to pure C++ for a bit and read it up in a good C++ book. ;)
-
A reference works the same way for any type. If you don't know how a reference works, you should go back to pure C++ for a bit and read it up in a good C++ book. ;)
Okay, thanks for help! :)