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

Author Topic: How to use SFML in my DLL?  (Read 2194 times)

0 Members and 1 Guest are viewing this topic.

epilepticPi

  • Newbie
  • *
  • Posts: 15
    • View Profile
    • Email
How to use SFML in my DLL?
« on: November 27, 2016, 05:24:08 pm »
I simply included SFML as usually and it worked. Then I wanted to make a dll using sfml. So I included it and started writing my code and the code was fine. But when i wanted to run it, vs2015 gave me some strange errors:
int the rect.inl:

Error   C2589'(': illegal token on right side of '::'    sfml-2.4.1\include\sfml\graphics\rect.inl   Line: 81   
Error   C2059   syntax error: '::' sfml-2.4.1\include\sfml\graphics\rect.inl   Line: 81   

And the same errors for diverse lines.

Mario

  • SFML Team
  • Hero Member
  • *****
  • Posts: 879
    • View Profile
Re: How to use SFML in my DLL?
« Reply #1 on: November 27, 2016, 06:33:19 pm »
You should show us some code. Are you including SFML sources? You should just link SFML (statically or dynamically) and not include code on your own. You're most likely screwing up (read: missing) some defines normally set when building SFML.

Jonny

  • Full Member
  • ***
  • Posts: 114
    • View Profile
    • Email
Re: How to use SFML in my DLL?
« Reply #2 on: November 28, 2016, 11:00:33 am »
Bit of a stab in the dark, but that line in rect.inl is using std::min. Are you by any chance on windows and including windows.h somewhere? If so, try defining "NOMINMAX" before you include it

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Laurent Gomila - SFML developer

 

anything