Setting up SFML with visual studios

Started by
13 comments, last by JWColeman 5 years, 4 months ago

i am having a really hard time setting up sfml with visual studios and have try a number of sources already and was wondering if somebody could help me out 

itachii

Advertisement
1 hour ago, itachii said:

i am having a really hard time setting up sfml with visual studios and have try a number of sources already and was wondering if somebody could help me out 

What have you tried that differs from the official guide: https://www.sfml-dev.org/tutorials/2.5/start-vc.php, and what problem are you having?

Programmer and 3D Artist

sorry it took me so long to respond i just go frustrated and left my laptop alone for a minute.

but this is my problem i set up everything right and followed all the directions on the website but i think the problem is that i did extract the right file to the right place. 

Capture.PNG

Capture(2).png

itachii

In your project go to: 

image.png.fe8ff3b4552f097584d8e2cd2b1c70fd.png

Click on where I have the circle under DEBUG MODE - then click EDIT.

Then paste the proper lib references under Additional Dependencies:

sfml-graphics-s-d.lib
sfml-window-s-d.lib
sfml-system-s-d.lib
sfml-main-d.lib
freetype.lib
opengl32.lib
winmm.lib
sfml-audio-s-d.lib
openal32.lib
flac.lib
vorbisenc.lib
vorbisfile.lib
vorbis.lib
ogg.lib

image.png.a697f80ba401e5e6571f4b1cbc70676c.png

Do the same for RELEASE mode:

sfml-graphics-s.lib
sfml-window-s.lib
sfml-system-s.lib
sfml-main.lib
freetype.lib
opengl32.lib
winmm.lib
sfml-audio-s.lib
openal32.lib
flac.lib
vorbisenc.lib
vorbisfile.lib
vorbis.lib
ogg.lib

Then you can link statically: 

image.png.936356c824255c53829159c19dcaada3.pngWith All Configurations selected, add: SFML_STATIC

If you don't want static linking then don't add SFML_STATIC, but keep in mind you'll need to include the .dll files with your EXE, and don't reference any of the lib files with "s", example: sfml-graphics-s-d.lib - use: sfml-graphics-d.lib (just remove the -s

For Debug:

sfml-graphics-d.lib
sfml-window-d.lib
sfml-system-d.lib
sfml-main-d.lib
freetype.lib
opengl32.lib
winmm.lib
sfml-audio-d.lib
openal32.lib
flac.lib
vorbisenc.lib
vorbisfile.lib
vorbis.lib
ogg.lib

 

For Release:

sfml-graphics.lib
sfml-window.lib
sfml-system.lib
sfml-main.lib
freetype.lib
opengl32.lib
winmm.lib
sfml-audio.lib
openal32.lib
flac.lib
vorbisenc.lib
vorbisfile.lib
vorbis.lib
ogg.lib

The above will also depend on what you're including, so use the guide as reference on the SFML site.

Let me know if this works.

Programmer and 3D Artist

this happen when i try static linking

Capture(3).PNG

itachii

3 minutes ago, itachii said:

this happen when i try static linking

Capture(3).PNG

This will only happen if you have the wrong "sfml-graphics-s-d.lib" and "sfml-graphics-s.lib" listed.

Please copy and paste your list for both DEBUG and RELEASE so I can see what you have.

Also if you run in DEBUG mode do you have the same issue?

Programmer and 3D Artist

yes the same thing happens on both

and thank you for helping me so far i really appreciate  it

Capture(4).PNG

itachii

What version of Visual Studio are you using, and which SFML build did you use?

https://www.sfml-dev.org/download/sfml/2.5.1/

Programmer and 3D Artist

visual studio 15/17 and 32 bit

Capture(5).PNG

Capture(6).PNG

itachii

Are you able to send me your project file?

(You can PM me the download link)

Programmer and 3D Artist

This topic is closed to new replies.

Advertisement