SFML community forums

Help => System => Topic started by: okeidar on November 01, 2014, 04:39:38 pm

Title: limker error when using sf::time operators
Post by: okeidar on November 01, 2014, 04:39:38 pm
Hello!
when i use a the operators of sf::time i get the following error
(click to show/hide)

now i have checked the linker settings and i do link it to sfml static libraries and define the precompiled header.
when i use sf::time methods other then the operators i get no messages

Thank you for reading :)
Title: Re: limker error when using sf::time operators
Post by: Gambit on November 02, 2014, 04:09:12 am
Precompiled header? Do you mean the preprocessor SFML_STATIC define? Also which version of SFML are you using and on what OS? Try getting the latest version and/or compiling from source.
Title: Re: limker error when using sf::time operators
Post by: okeidar on November 02, 2014, 08:24:00 am
Yes, I meant preprocessor SFML_STATIC, thank you.
i use sfml 2.1 on VS2010 on Windows 7.
I thought i might not have the most recent version so i downloaded the latest.
Title: Re: limker error when using sf::time operators
Post by: okeidar on November 02, 2014, 08:59:46 am
OK i have changed the calling convention from __stdcall to __cdecl
and it fixed the errors.
can anyone explain how does it matters?
Title: Re: limker error when using sf::time operators
Post by: wintertime on November 02, 2014, 11:04:05 am
If you set incompatible compiler options you want to get an error, because thats much better than silent corruption at runtime.
Title: Re: limker error when using sf::time operators
Post by: okeidar on November 02, 2014, 11:41:39 am
yes i understand, but why does sf::time operators work with __cdecl and not with __stdcall?
Title: Re: limker error when using sf::time operators
Post by: wintertime on November 02, 2014, 01:25:26 pm
Because they were compiled that way. (You would need to recompile all libraries with the same setting to make them compatible, but thats much pain for a tiny or possibly even negative gain. You better dont waste time on such microoptimizations.)
Title: Re: limker error when using sf::time operators
Post by: Laurent on November 02, 2014, 03:12:33 pm
Well... there's no reason why a default SFML build wouldn't work with a standard Visual Studio 2010 project. And there's no reason why only sf::Time operators would trigger such a linker error.

I'd say there's something wrong in your environment, but it's hard to say what.
Title: Re: limker error when using sf::time operators
Post by: okeidar on November 02, 2014, 08:29:44 pm
Well... there's no reason why a default SFML build wouldn't work with a standard Visual Studio 2010 project. And there's no reason why only sf::Time operators would trigger such a linker error.

I'd say there's something wrong in your environment, but it's hard to say what.

well i  hope ot wont happen again :)
its wierd because i read that windows application should compile with __stdcall and that WINAPI is actually an __stdcall definition..

thanks everybody:)