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

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - AlexRTX

Pages: [1]
1
General / Re: Static linking and website tutorial
« on: March 07, 2014, 10:23:24 am »
Thank you ! I managed to compile it now without the work-around by linking all the libs :

sfml-system-s.lib
sfml-window-s.lib
sfml-audio-s.lib
sfml-graphics-s.lib
sfml-main.lib
freetype.lib
glew.lib
jpeg.lib
opengl32.lib
winmm.lib
gdi32.lib

It seems kinda odd that I link opengl32 the same way I link the other libs although it's not located in the Additional Dependencies folder that i specified.

Yes, my mistake, sorry. I forgot that I copied those 2 DLLs in the bin folder of VC. Thank you again for helping me ! Can I somehow include them in the exe ?


2
General / Static linking and website tutorial
« on: March 07, 2014, 10:03:19 am »
Hey there,

I just compiled SFML for Visual Studio 2013 and as I am just at the start of learning programming I have a few questions and I would really appreciate if you could help me.

1. I specified the additional dependencies in the Linker ( sfml-system-s.lib sfml-window-s.lib sfml-audio-s.lib sfml graphics-s.lib sfml-main.lib ) and the preprocessor definition ( SFML_STATIC ) but I couldn't compile a simple example of SFML code from the website. It seems that there were some kind of external dependency errors. I eventually got over them with  :

#ifdef SFML_STATIC
#pragma comment(lib, "glew.lib")
#pragma comment(lib, "freetype.lib")
#pragma comment(lib, "jpeg.lib")
#pragma comment(lib, "opengl32.lib")
#pragma comment(lib, "winmm.lib")
#pragma comment(lib, "gdi32.lib")  
#endif // SFML_STATIC

As I understand the libraries that I included depend on other libraries ( the ones above ) and I have to link them too. The above code includes them if it finds the SFML_STATIC def. Now, from what I understand this is not the proper way to do it. I want to link them as I linked the other libraries but I can't seem to find all of them. For example, in the lib folder I have the glew, freetype, jpeg but not the opengl32, winm or gdi32. Where can I find them ?

2. On the tutorial section of the website it says :
Quote
If you are using the sfml-audio module (either statically or dynamically), you must also copy the DLLs of the external libraries needed by it, which are libsndfile-1.dll and OpenAL32.dll.

Although I linked the audo lib to the project and also included <SFML/Audio.hpp> the application works without having the 2 DLL in the same folder. Why is that ? Also, can those 2 libs be linked like the static libs that I linked previously ? Do they really need to be there as dynamic libraries ? If so, why is that and why does my program run without the DLLs or without even linking them ?

Appreciate your help !

Pages: [1]
anything