SDL_LoadObject not working!

Ok so here is my code :slight_smile:

 		//void *mylib = dlopen(Modname, RTLD_LAZY);
		void *myobj = SDL_LoadObject(Modname);
		if (myobj == NULL) printf("Can't load object %s\n", modname);

This doesn’t seem to work.

However if I remove the comment from the dlopen then (both the dlopen and) the SDL_LoadObject also works!

The Modname is fully qualified (contains the complete path to the library).

What am I doing wrong?

Does SDL_GetError() tell you anything useful ( printf("Can't load object %s : %s\n", modname, SDL_GetError());)?
Does dlopen() still work with RTLD_NOW | RTLD_LOCAL instead of RTLD_LAZY? Because that’s the flags that SDL passes.
If it doesn’t you might want to debug that (independently of SDL), if you’re on Linux, the LD_DEBUG environment variable might help, see and

Yeah looking into it.

If claims there is an undefined symbol :


That’s odd I know I have that linked and I have used the function several times in my code!

There must be something I can do tho help dlopen find this!

I’ll keep looking!