SFML community forums
Help => Graphics => Topic started by: fixus971 on October 06, 2008, 12:06:12 am
-
error:
Access violation reading location 0x00000000
in:
Context.cpp of SFML SVN compiled with VS9 C++
at:
void Context::SetActive(bool Active)
{
myDummyWindow->SetActive(Active);
}
where:
in my program and in SFML samples too.
to try:
simply put variable definition "sf::String sfs;" before main()
I need it to share same String settings in many files of my program.
-
I'll check this as soon as possible, thanks for your feedback.
-
Just ckecked with 895, DLL build, and no such problem.
Did you use static or dynamic linking ?
-
Don't try to reproduce it ;)
The problem is probably that his global sf::String is constructed before the global sf::Context, as the order of initialization of globals is undefined across compile units.
I'll fix it with an explicit function call to get the context (in internal code), so that it's always created when someone needs it.
-
Thaks SirJulio & Laurent.
I found same problem trying with static variable in class but declaration remain out in .cpp and get same problem.
I solve my problem coping String initialization instructions in all 4 files/class.
So isn't simple share same Font on many class. (for now I'm ok)
Thanks
-
I've made a fix ; maybe you can try the latest revision with your global variables and make sure it works now :)
-
Wow Great Laurent. I-ll check as soon as possible. Thanks
-
:oops: Sorry but I get only a small change..
Now Program don't halt on variable definition on XP SP2
But still halt on
App.Create(Mode, "Test", sf::Style::Close);
Same assembler error.. only different address.
Otherwise on Win2000 halt again on variable definition..
I try to install MS VS C++ on it but Setup said me that I can't install it on Win2000.
-
Can you give a complete minimal example which reproduces the problem ?
-
Sorry..
I mixed this forum topic with a similar one:
http://www.sfml-dev.org/forum/viewtopic.php?t=676&postdays=0&postorder=asc&start=0
I mixed that 2 post because I get similar error when use a sample mini code(in above post) compiled as Release on other PC where I haven't compiler.
Now I retested with previous code that give me problem of this topic, recompiled all as default and see that now all go OK! ..on Developer PC.
Thanks
-
Ah, I prefer that ;)