The SDL forums have moved to discourse.libsdl.org.
This is just a read-only archive of the previous forums, to keep old links working.


SDL Forum Index
SDL
Simple Directmedia Layer Forums
What's the role of the 3 different library files of SDL 2.0?
Bitious


Joined: 22 Jul 2013
Posts: 2
Hey everyone :)

First of all I'm new to the C++ scene, and also brand new to SDL. While setting up SDL and getting everything ready, I wondered what the library files: "SDL2.lib", "SDL2main.lib" as well as "SDL2test.lib" are individually good for? And do I need to add them all as dependencies or does it entirely depend on what functionality I need from SDL?

My own current guess is that they each let you gain access to different modules of SDL, such as "SDL2test" granting access to calls having to do with debugging functionality and such of SDL? Though this is all complete speculation on my part as I weren't able to find any documentation on it.

Thank you all for your time Smile It is much appriciated.
Re: What's the role of the 3 different library files of SDL
neoaggelos


Joined: 02 Jan 2013
Posts: 138
SDL2main and SDL2test are two auxillary libraries for SDL2.

SDL2main provides SDL_main(), which is a global entry point for all SDL apps. You are not required/forced to use it, but is presence is based on the variety of the systems SDL supports. Windows uses WinMain(), Linux uses main(), Android needs JNI and some Java to actually use SDL, so SDL_main() makes things a little easier.

SDL2test on the other hand, provides some functions not directly related to the purpose of SDL. Some are useful for ordinary programs, others are directly related to the test programs, it's your choice to use them or ignore them.

Neither SDL2main nor SDL2test are required if you want to use SDL2, they are just some good choices.

Bitious wrote:
Hey everyone :)

First of all I'm new to the C++ scene, and also brand new to SDL. While setting up SDL and getting everything ready, I wondered what the library files: "SDL2.lib", "SDL2main.lib" as well as "SDL2test.lib" are individually good for? And do I need to add them all as dependencies or does it entirely depend on what functionality I need from SDL?

My own current guess is that they each let you gain access to different modules of SDL, such as "SDL2test" granting access to calls having to do with debugging functionality and such of SDL? Though this is all complete speculation on my part as I weren't able to find any documentation on it.

Thank you all for your time Smile It is much appriciated.
What's the role of the 3 different library files of SDL 2.0?
Andreas Schiffler
Guest

FYI - the SDL2_test lib is a static library and has two main components:
1) common stuff used by all test executables (CommonState, CommonArgs, CommonEvent, etc.)
2) harness and helper function (logger, asserts, data fuzzer, etc.) for test automation suites

On 7/22/2013 12:07 PM, neoaggelos wrote:

Quote:
SDL2main and SDL2test are two auxillary libraries for SDL2.

SDL2main provides SDL_main(), which is a global entry point for all SDL apps. You are not required/forced to use it, but is presence is based on the variety of the systems SDL supports. Windows uses WinMain(), Linux uses main(), Android needs JNI and some Java to actually use SDL, so SDL_main() makes things a little easier.

SDL2test on the other hand, provides some functions not directly related to the purpose of SDL. Some are useful for ordinary programs, others are directly related to the test programs, it's your choice to use them or ignore them.

Neither SDL2main nor SDL2test are required if you want to use SDL2, they are just some good choices.








Bitious wrote: Hey everyone

First of all I'm new to the C++ scene, and also brand new to SDL. While setting up SDL and getting everything ready, I wondered what the library files: "SDL2.lib", "SDL2main.lib" as well as "SDL2test.lib" are individually good for? And do I need to add them all as dependencies or does it entirely depend on what functionality I need from SDL?

My own current guess is that they each let you gain access to different modules of SDL, such as "SDL2test" granting access to calls having to do with debugging functionality and such of SDL? Though this is all complete speculation on my part as I weren't able to find any documentation on it.

Thank you all for your time It is much appriciated.




C is the God's Programming Language


Quote:
_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
Bitious


Joined: 22 Jul 2013
Posts: 2
Aha, that clears up a lot of things for me then Smile Always good to know things in a bit more detail! Thank you both for the help, it is much appreciated.