[SDL] cross-compile demos of SDL-1.2.5

huangwei at sunplus.com.cn huangwei at sunplus.com.cn
Thu Jan 2 21:56:01 PST 2003


when cross-compiling testver.c,there are some errors as follows:

testver.tmp:In function 'main':
testver.tmp(.text+0xdc):undefined reference to 'SDL_Linked_Version'
testver.tmp(.text+0xf4):undefined reference to 'SDL_Linked_Version'
testver.tmp(.text+0x10c):undefined reference to 'SDL_Linked_Version'
....
then I copy the same content of SDL_version.h into testver.c,as below:

#define SDL_MAJOR_VERSION 1
#define SDL_MINOR_VERSION 2
#define SDL_PATCHLEVEL    5
#define SDL_VERSION(X)
{
     (X)->major = SDL_MAJOR_VERSION;     \
     (X)->minor = SDL_MINOR_VERSION;     \
     (X)->patch = SDL_PATCHLEVEL;  \
}
#define SDL_VERSIONNUM(X, Y, Z)    (X)*1000+(Y)*100+(Z)
#define SDL_COMPILEDVERSION   \
     SDL_VERSIONNUM(SDL_MAJOR_VERSION, SDL_MINOR_VERSION, SDL_PATCHLEVEL)
#define SDL_VERSION_ATLEAST(X, Y, Z)     \
     (SDL_COMPILEDVERSION >= SDL_VERSIONNUM(X, Y, Z))
typedef struct{
     Unit8 major;
     Unit8 minor;
     Unit8 patch;
}SDL_Version;

static SDL_Version version =
     {SDL_MAJOR_VERSION, SDL_MINOR_VERSION, SDL_PATHCLEVEL};

const SDL_version * SDL_Linked_Version(void)
{
     return(&version);
}

...

then it can be compile successfully.

I don't know why...
who can tell me?

Regards,
Andy








More information about the SDL mailing list