Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: limker error when using sf::time operators  (Read 6680 times)

0 Members and 1 Guest are viewing this topic.

okeidar

  • Newbie
  • *
  • Posts: 5
    • View Profile
limker error when using sf::time operators
« 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 :)

Gambit

  • Sr. Member
  • ****
  • Posts: 283
    • View Profile
Re: limker error when using sf::time operators
« Reply #1 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.

okeidar

  • Newbie
  • *
  • Posts: 5
    • View Profile
Re: limker error when using sf::time operators
« Reply #2 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.

okeidar

  • Newbie
  • *
  • Posts: 5
    • View Profile
Re: limker error when using sf::time operators
« Reply #3 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?

wintertime

  • Sr. Member
  • ****
  • Posts: 255
    • View Profile
Re: limker error when using sf::time operators
« Reply #4 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.

okeidar

  • Newbie
  • *
  • Posts: 5
    • View Profile
Re: limker error when using sf::time operators
« Reply #5 on: November 02, 2014, 11:41:39 am »
yes i understand, but why does sf::time operators work with __cdecl and not with __stdcall?

wintertime

  • Sr. Member
  • ****
  • Posts: 255
    • View Profile
Re: limker error when using sf::time operators
« Reply #6 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.)

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: limker error when using sf::time operators
« Reply #7 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.
Laurent Gomila - SFML developer

okeidar

  • Newbie
  • *
  • Posts: 5
    • View Profile
Re: limker error when using sf::time operators
« Reply #8 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:)