Multithreaded setting in MSVC

hi,

first of all, I am no windows expert, and thus i hope someone here can
help me.

i have to port our video-player from linux to windows. that should’t be
a big problem, with sdl. but for me, it is. under linux everything works

fine.
but under windows, i have the problem, that i have to set the
’code-generation’-tab to ‘multithreaded dll’. for sdl-use. but, if i do
so, get some mysterious crashes. i can’t tell the exact position in the
code, because the application crashes at different locations ??

if i compile with the ‘code-generation’-tab set to ‘multithreaded’ only,

everything in the programm works fine, until SDL_init. here i get an
access violation.

i tried to compile SDL myself, with ‘multithreaded’ option, but linking
this ‘SDL_Static_lib’ fails because of undefined external sybols.

does anybody know, how to cope with my problem?

thanks in advance
christian

Hi,

First of all, what version of Visual C++ are you using? Hopefully it is VC6,
then I can help you here. Secondly, what version of SDL are you using? I
have used both 1.2.1 and 1.2.2 recently and had no problems.

Let us assume that you are using VC6 and SDL 1.2.2. You have created a
directory, C:\SDL-1.2.2 and extracted SDL there. You have then extracted the
VisualC.zip which comes with SDL into that directory - so now you have
C:\SDL-1.2.2\VisualC. Go into the VisualC directory and load the SDL
workspace file there. Build the files (with VC6 you do that by using
Build->Set Active Configuration), meaning you have to select SDL and build
that, then SDLmain and build that too. Then you have the .LIB files and the
.DLL file that you need.

Make sure that you add the LIB files to your project and make sure you copy
the SDL.DLL into the directory where your project is. Add the
C:\SDL-1.2.2\include directory to your project, then select “Multi-threaded
DLL”. Build your project.

I can’t see why, if after doing what I’ve written here, you are having
problems.

but under windows, i have the problem, that i have to set the
’code-generation’-tab to ‘multithreaded dll’. for sdl-use. but, if i do
so, get some mysterious crashes. i can’t tell the exact position in the
code, because the application crashes at different locations ??

What application? The compiler? Or your program?

if i compile with the ‘code-generation’-tab set to ‘multithreaded’ only,

everything in the programm works fine, until SDL_init. here i get an
access violation.

It needs to be multi-threaded DLL.

i tried to compile SDL myself, with ‘multithreaded’ option, but linking
this ‘SDL_Static_lib’ fails because of undefined external sybols.

Did you include the .LIB files to the project? You need to add them, not
just copy them into the directory…

does anybody know, how to cope with my problem?

Not from what you’ve written, no. :o

Neil.