wuiiz93
wuiiz93

Reputation: 131

Integrating SFML with Visual C++ 2017

I tried integrating SFML with my visual c++ project, careful to follow the procedure on the SFML website and received 2 main types of errors. The first offending line in the file rect.inl is :

T minX = std::min(left, static_cast(left + width));

The description of the first kind of error reads:

'(': illegal token on right side of '::' c:\libs\c++\sfml-2.5.1-windows-vc15-32-bit\sfml-2.5.1\include\sfml\graphics\rect.inl 81

the other kind of error is:

template Rect::Rect() : left (0), top (0), width (0), height(0) { } :

Rect is not a template ChessApplication C:\Libs\c++\SFML-2.5.1-windows-vc15-32-bit\SFML-2.5.1\include\SFML\Graphics\Rect.inl 28

My project setup is:

Microsoft Visual Studio Community 2017 Version 15.9.9 VisualStudio.15.Release/15.9.9+28307.518 Microsoft .NET Framework Version 4.7.03056

Additional Library Directories: C:\Libs\c++\SFML-2.5.1-windows-vc15-32-bit\SFML-2.5.1\lib

Additional Include Directories: C:\Libs\c++\SFML-2.5.1-windows-vc15-32-bit\SFML-2.5.1\include

Additional dependencies (debug): sfml-window-d.lib;sfml-graphics-d.lib;sfml-system-d.lib;sfml-audio-d.lib

Additional dependencies (release): sfml-window.lib;sfml-graphics.lib;sfml-system.lib;sfml-audio.lib

I used dynamic linking, placing sfml-xxx-2.dll files in the same directory as the .sln project.

Upvotes: 0

Views: 677

Answers (1)

wuiiz93
wuiiz93

Reputation: 131

I solved the problem by removing the precompiled header "stadfx.h" from my classes.

Upvotes: 0

Related Questions