Remember me

Lost Password?

Register now!


Who's Online
77 user(s) are online (56 user(s) are browsing Forums)

Members: 0
Guests: 77


Support us!


Report message:*

Re: SDL2

Subject: Re: SDL2
by kas1e on 2021/3/1 12:00:12

There is very easy pattern to follow to fix all possible "undefined" errors on the linking stage.

You have your SDK directory in which we imagine you unpack all the stuff already (lots of 3d party libs, includes, etc from os4depot). Once you have any undefine , you do search in all your *.a files on that undefine.
I.e. for search in all *.a files in whole SDK for "ov_clear". Find out then in which one : it will be or libogg.a, or libvorbis.a or libvorbisfile.a or something. Then, you need to know that linking order is matter : the *.a lib which ask for undefined symbold come first, then you add -l_lib_which_you_find. Usually that one will ALSO ask for some undefines, you search in which one, add it as well, etc, etc.

I.e. that just boring, routine work.

If you didn't find those undefined function names in your SDK, it then time to go on os4depot, and find out libs where they used. Offten can be understandable from the name of undefined functions. But if not, you then type in google "ov_read", and after few links will find out from where it comes => download/install to SDK => add on linking stage after library asking for undefs.

But most of us just use our strings workng everywhere most of time, like one Javier show.

For example my "usual for SDL2 apps" line is:


-lSDL2 -lSDL2_mixer -lmikmod -lmodplug -lflac -lsmpeg2 -lvorbisfile -lvorbis -logg -lSDL2_ttf -lSDL2_image -lSDL2_gfx -lpng -ljpeg -ltiff -lwebp -lfreetype -lm -lz -lpthread

What I mean, that the most important thing there to understand is that once you add linking with let's say SDL_Image, it will need image libs as well (libpng, libjpeg, libtiff,etc) and without will bring undefs. SDL_Mixer need sound/music libs as well: mikmod, flac, smpeg, and so on, and without will give undefs. Freetype library also needs few other libs. But basically, once you got that linking order is important and that its all "flat" (i.e. undefs in one library just fixed by adding necessary library after guilty one) everything will be easy.

Powered by XOOPS 2.0 © 2001-2016 The XOOPS Project