SDL_LoadObject with Visual Studio Express

Hello,

I’ve recently been toying with Visual Studio Express. For Windoze I’m usually
using Mingw. I’ve run into a slight problem that would halt my further
explorations of Visual Studio if it turns out to mean what I think it means.

I built SDL 1.2.9 using the provided VisualC solution, so this isn’t the
provided binary off the website.

I have some basic code such as:

void *somedll;
void (*dosomething)(void);
somedll = SDL_LoadObject(“some.dll”);
dosomething = SDL_LoadFunction(somedll,“dosomething”);

Now, that compiles fine. But when linking, I get an error to the effect of
Unable to resolve _SDL_LoadObject
Unable to resolve _SDL_LoadFunction

I know that LoadObject/Function are based off the posix dlsym functions. Mingw
emulate posix so that it works ok on that. But is there no way to get those
two functions working within Visual Studio?

Thanks,
Micah

Hello,

I’ve recently been toying with Visual Studio Express. For Windoze I’m usually
using Mingw. I’ve run into a slight problem that would halt my further
explorations of Visual Studio if it turns out to mean what I think it means.

I built SDL 1.2.9 using the provided VisualC solution, so this isn’t the
provided binary off the website.

Make sure that SDL_loadso.c is in the Visual Studio project.
I’m completely revamping the projects for 1.2.10, so don’t worry about
sending any fixes in to do that.

See ya!
-Sam Lantinga, Senior Software Engineer, Blizzard Entertainment

Sam Lantinga <slouken devolution.com> writes:

Make sure that SDL_loadso.c is in the Visual Studio project.
I’m completely revamping the projects for 1.2.10, so don’t worry about
sending any fixes in to do that.

See ya!
-Sam Lantinga, Senior Software Engineer, Blizzard Entertainment

Well… I COULD do that… But… but…
heh, joking. Yep, that fixed it. Everything loads up perfectly now (well, at
least it is now that I remembered that you have to declspec each function in the
dll that I want public)

I promise, once I get the beginner stuff over with, I’ll start asking more
intelligent questions.

Thanks for the fast and accurate help!

Micah