OK, I tried it all again. Here is what I did:
1) Rename my old Pelles C installation to PellesCbak
2) Reinstall PellesC 4.5 from the files here:
http://www.smorgasbordet.com/pellesc/3) Make a new console project, called SDL
4) Download and unzip the files SDL-devel-1.2.12-VC6.zip and SDL-1.2.12-win32.zip from this website:
http://www.libsdl.org/download-1.2.php5) Copy the files SDL_win32_main.c and version.rc into the new SDL project directory.
6) Copy all the files in the include directory of the SDL files to the PellesC\Include directory.
7) Copy the SDL.dll file to the PellesC\Bin directory
Copy the SDL.lib file to the PellesC\Lib directory
9) Add an SDL program to the project (sdlexample.c below)
10) Add SDL_win32_main.c to the project
11) Select the compiler options "Enable Microsoft extensions" and "__cdecl" as the calling convention.
12) Add sdl.lib to the list of object and lib files under linker options.
At this point the project compiles, but gives the same error message about the dll file.
If I add version.rc to the project it doesn't compile because it looks for a nonexistent afxres.h included from the version.rc file. If I comment this out, it compiles, but does not run (with the same error message).
Here is the program I am compiling (sdlexample.c):
/**********************************************************************/
#include <stdio.h>
#include "SDL.h"
#define WIDTH 640
#define HEIGHT 480
#define BPP 4
#define DEPTH 32
void setpixel(SDL_Surface *screen, int x, int y, Uint8 r, Uint8 g, Uint8 b)
{
Uint32 *pixmem32;
Uint32 colour;
colour = SDL_MapRGB( screen->format, r, g, b );
pixmem32 = (Uint32*) screen->pixels + y + x;
*pixmem32 = colour;
}
void DrawScreen(SDL_Surface* screen, int h)
{
int x, y, ytimesw;
if(SDL_MUSTLOCK(screen))
{
if(SDL_LockSurface(screen) < 0) return;
}
for(y = 0; y < screen->h; y++ )
{
ytimesw = y*screen->pitch/BPP;
for( x = 0; x < screen->w; x++ )
{
setpixel(screen, x, ytimesw, (x*x)/256+3*y+h, (y*y)/256+x+h, h);
}
}
if(SDL_MUSTLOCK(screen)) SDL_UnlockSurface(screen);
SDL_Flip(screen);
}
int main(int argc, char* argv[])
{
SDL_Surface *screen;
SDL_Event event;
int keypress = 0;
int h=0;
if (SDL_Init(SDL_INIT_VIDEO) < 0 ) return 1;
if (!(screen = SDL_SetVideoMode(WIDTH, HEIGHT, DEPTH, SDL_FULLSCREEN|SDL_HWSURFACE)))
{
SDL_Quit();
return 1;
}
while(!keypress)
{
DrawScreen(screen,h++);
while(SDL_PollEvent(&event))
{
switch (event.type)
{
case SDL_QUIT:
keypress = 1;
break;
case SDL_KEYDOWN:
keypress = 1;
break;
}
}
}
SDL_Quit();
return 0;
}
/************************************************************************/
Here is the project file which Pelles C creates:
/************************************************************************/
#
# PROJECT FILE generated by "Pelles C for Windows, version 4.50".
# WARNING! DO NOT EDIT THIS FILE.
#
POC_PROJECT_VERSION = 4.00#
POC_PROJECT_TYPE = 3#
POC_PROJECT_ARGUMENTS = #
POC_PROJECT_WORKPATH = #
POC_PROJECT_EXECUTOR = #
CC = pocc.exe#
AS = poasm.exe#
RC = porc.exe#
LINK = polink.exe#
CCFLAGS = -Tx86-coff -Ot -W1 -Gd -Ze #
ASFLAGS = -AIA32 -Gd#
RCFLAGS = -r#
LINKFLAGS = -subsystem:console -machine:ix86 kernel32.lib advapi32.lib delayimp.lib sdl.lib#
.SILENT:
#
# Build SDL.exe.
#
SDL.exe: \
output\SDL_win32_main.obj \
output\sdlexample.obj
$(LINK) $(LINKFLAGS) -out:"$@" $**
#
# Build SDL_win32_main.obj.
#
output\SDL_win32_main.obj: \
SDL_win32_main.c \
..\..\Include\SDL.h \
..\..\Include\SDL_main.h \
..\..\Include\SDL_stdinc.h \
..\..\Include\SDL_config.h \
..\..\Include\SDL_platform.h \
..\..\Include\SDL_config_minimal.h \
..\..\Include\begin_code.h \
..\..\Include\close_code.h \
..\..\Include\SDL_audio.h \
..\..\Include\SDL_error.h \
..\..\Include\SDL_endian.h \
..\..\Include\SDL_mutex.h \
..\..\Include\SDL_thread.h \
..\..\Include\SDL_rwops.h \
..\..\Include\SDL_cdrom.h \
..\..\Include\SDL_cpuinfo.h \
..\..\Include\SDL_events.h \
..\..\Include\SDL_active.h \
..\..\Include\SDL_keyboard.h \
..\..\Include\SDL_keysym.h \
..\..\Include\SDL_mouse.h \
..\..\Include\SDL_video.h \
..\..\Include\SDL_joystick.h \
..\..\Include\SDL_quit.h \
..\..\Include\SDL_loadso.h \
..\..\Include\SDL_timer.h \
..\..\Include\SDL_version.h
$(CC) $(CCFLAGS) "$!" -Fo"$@"
#
# Build sdlexample.obj.
#
output\sdlexample.obj: \
sdlexample.c \
..\..\Include\SDL.h \
..\..\Include\SDL_main.h \
..\..\Include\SDL_stdinc.h \
..\..\Include\SDL_config.h \
..\..\Include\SDL_platform.h \
..\..\Include\SDL_config_minimal.h \
..\..\Include\begin_code.h \
..\..\Include\close_code.h \
..\..\Include\SDL_audio.h \
..\..\Include\SDL_error.h \
..\..\Include\SDL_endian.h \
..\..\Include\SDL_mutex.h \
..\..\Include\SDL_thread.h \
..\..\Include\SDL_rwops.h \
..\..\Include\SDL_cdrom.h \
..\..\Include\SDL_cpuinfo.h \
..\..\Include\SDL_events.h \
..\..\Include\SDL_active.h \
..\..\Include\SDL_keyboard.h \
..\..\Include\SDL_keysym.h \
..\..\Include\SDL_mouse.h \
..\..\Include\SDL_video.h \
..\..\Include\SDL_joystick.h \
..\..\Include\SDL_quit.h \
..\..\Include\SDL_loadso.h \
..\..\Include\SDL_timer.h \
..\..\Include\SDL_version.h
$(CC) $(CCFLAGS) "$!" -Fo"$@"
.EXCLUDEDFILES:
/************************************************************************/
It makes no difference if I select multithreaded dll (the -MT option you use).
Thanks again for taking the time to help me with this problem.
Bill Hart.