I just built an updated version of SDL.dll, an open-source C DLL that my Delphi project uses, with the Express edition of Visual C++ 2005. I dropped it in the folder with my EXE and tried to run it, but it won’t load:
The procedure entry point SDL_RWFromFP could not be located in the dynamic link library SDL.dll.
Now C never was my strong point, but I remember enough of it from college to try and track this one down. I went poking around in the source code to see what had happened to this function, and I found it grayed out, beneath a preprocessor directive:
#ifdef HAVE_STDIO_H
IIRC, STDIO is the standard C I/O library. I assume this means that it’s not available. Anyone know why that would be and how to fix it? Is this a Visual C++ issue or an SDL one?
Most often in the Unix/Linux world, names like
HAVE_STDIO_Hindicate that the code has been ‘autoconfiscated’ (which is the official term used to describe the state of having been made to work with the ‘autotools’ such as ‘autoconf’). In such a set up, the configure process would determine whether<stdio.h>was available and would set#define HAVE_STDIO_H 1in theconfig.hfile that it generates. The compilation would then discover that the platform has<stdio.h>and would compile the matching code (the stuff that is currently greyed out).Adapting to your Windows environment, somewhat less than 100% confidently since there could be some other significance to
HAVE_STDIO_Hon Windows, you might decide that it would be OK to include-DHAVE_STDIO_Hin the command line options when you run the compiler. Or you might create the config file by hand, and define-DHAVE_CONFIG_H(which is the normal way to indicate that configuration settings are in the file ‘config.h’). In the ‘config.h’ file, you’d have#define HAVE_STDIO_H 1as mentioned above.Note: on Unix, you normally find a shell script called ‘configure’ which you run to create the config.h file. If you have Cygwin, there’s an outside chance that you can use that script on Windows – I’ve just checked that an autoconfiscated package I created on Solaris was configurable on Windows under Cygwin and it mostly worked – all except some network handling. I’d not guarantee that it will always fail (but it’s software – guaranteeing anything is pretty dangerous). I should add that the problem is in my auto-configuration code (the tests for the network functionality clearly aren’t quite correct), and not in Cygwin per se. If I’d done the job properly, it would have worked. (Someone said ‘There is no portable code; there is only code that has been ported’. That applies here.)
You do need a good simulation of a Unix environment. MingW might also work.