What's the role of the 3 different library files of SDL 2.0?

Hey everyone :slight_smile:

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 :slight_smile: It is much appriciated.

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 :slight_smile:

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 :slight_smile: It is much appriciated.


C is the God’s Programming Language

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 suitesOn 7/22/2013 12:07 PM, neoaggelos wrote:

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 Smile

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.


C is the God’s Programming Language


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

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