Problem compling with OpenWatcom

Hi,

i am currently in the process of porting a simple SDL application from Linux to
Windows using the OpenWatcom Compiler.

The problem is, that i always get the following error, as soon as i include the
SDL.h file:

Error! E2028: __CHK is an undefined reference
Error! E2028: __iob is an undefined reference
Error! E2028: fprintf
is an undefined reference

for example, when i try to compile the following, very simple source the error
occurs:

#include <stdio.h>
#include <stdlib.h>
#include “lib\include\SDL.h”

int main( int argc, char* argv[] )
{
fprintf( stdout, “Hello, World!\n” );
return 0;
}

when the SDL.h is not included everything compiles fine and clean.

I use the following commands to compile the source above:

wcc386 /ei /6r main.c
wlink system nt file main.obj library lib\lib\sdl.lib

Any suggestions?

Bye, Egon

I’m not sure about watcom compilers, but I do recommend especially for
cross-platform compiling to use MinGW and MSYS. It would seem OpenWatcom
isn’t compatible.
http://www.mingw.org

Egon Rath wrote:>Hi,

i am currently in the process of porting a simple SDL application from Linux to
Windows using the OpenWatcom Compiler.

The problem is, that i always get the following error, as soon as i include the
SDL.h file:

Error! E2028: __CHK is an undefined reference
Error! E2028: __iob is an undefined reference
Error! E2028: fprintf
is an undefined reference

for example, when i try to compile the following, very simple source the error
occurs:

#include <stdio.h>
#include <stdlib.h>
#include “lib\include\SDL.h”

int main( int argc, char* argv[] )
{
fprintf( stdout, “Hello, World!\n” );
return 0;
}

when the SDL.h is not included everything compiles fine and clean.

I use the following commands to compile the source above:

wcc386 /ei /6r main.c
wlink system nt file main.obj library lib\lib\sdl.lib

Any suggestions?

Bye, Egon


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl

The problem is, that i always get the following error, as soon as i include the
SDL.h file:

Error! E2028: __CHK is an undefined reference
Error! E2028: __iob is an undefined reference
Error! E2028: fprintf
is an undefined reference

Hi again,

in the meantime i played around a litte to explore whats going wrong here - i
found the solution in commenting out the line

        #define main	SDL_main

in the file “include\SDL_main.h”.

Now everything works great.

Bye, Egon