I don't feel like trying to understand it and make it work for 64-bit (at least now), but I do have multilib installed. It it possible to compile it as 32-bit?
sure, like this:
Code:
CFLAGS=-m32 LDFLAGS=-m32 make LINUX=1
I don't feel like trying to understand it and make it work for 64-bit (at least now), but I do have multilib installed. It it possible to compile it as 32-bit?
CFLAGS=-m32 LDFLAGS=-m32 make LINUX=1
// Read wad header without depending on integer size and
// endianness of the processor
int W_ReadHeader(FILE *handle, wadinfo_t *wadinfo)
{
unsigned char buffer[12];
if (fread(buffer, 1, 12, handle) != 12) return 0;
memcpy(wadinfo->identification, buffer, 4);
wadinfo->numlumps = buffer[4];
wadinfo->numlumps |= ((UINT32) buffer[5]) << 8;
wadinfo->numlumps |= ((UINT32) buffer[6]) << 16;
wadinfo->numlumps |= ((UINT32) buffer[7]) << 24;
wadinfo->infotableofs = buffer[8];
wadinfo->infotableofs |= ((UINT32) buffer[9]) << 8;
wadinfo->infotableofs |= ((UINT32) buffer[10]) << 16;
wadinfo->infotableofs |= ((UINT32) buffer[11]) << 24;
return 1;
}
// Read wad lump directory without depending on integer size and
// endianness of the processor
int W_ReadLumpDir(FILE *handle, wadinfo_t *header, filelump_t *info)
{
if (fseek(handle, header->infotableofs, SEEK_SET)) return 0;
UINT32 i;
for (i=0; i<header->numlumps; i++)
{
unsigned char buffer[16];
if (fread(buffer, 1, 16, handle) != 16) return 0;
info->filepos = buffer[0];
info->filepos |= ((UINT32) buffer[1]) << 8;
info->filepos |= ((UINT32) buffer[2]) << 16;
info->filepos |= ((UINT32) buffer[3]) << 24;
info->size = buffer[4];
info->size |= ((UINT32) buffer[5]) << 8;
info->size |= ((UINT32) buffer[6]) << 16;
info->size |= ((UINT32) buffer[7]) << 24;
memcpy(info->name, buffer+8, 8);
info++;
}
return 1;
}
$ ../Linux/Debug/lsdlsrb2
Looking for WADs in: SRB2WADDIR,.
Attempting to load WAD file: /home/michael/scm/svn/code.srb2.org/SRB2/vendor/SRB2CBv1.1/bin/Resources/srb2.srb
Attempting to load WAD file: /home/michael/scm/svn/code.srb2.org/SRB2/vendor/SRB2CBv1.1/bin/Resources/zones.dta
Attempting to load WAD file: /home/michael/scm/svn/code.srb2.org/SRB2/vendor/SRB2CBv1.1/bin/Resources/sonic.plr
Attempting to load WAD file: /home/michael/scm/svn/code.srb2.org/SRB2/vendor/SRB2CBv1.1/bin/Resources/tails.plr
Attempting to load WAD file: /home/michael/scm/svn/code.srb2.org/SRB2/vendor/SRB2CBv1.1/bin/Resources/knux.plr
Attempting to load WAD file: /home/michael/scm/svn/code.srb2.org/SRB2/vendor/SRB2CBv1.1/bin/Resources/rings.wpn
Attempting to load WAD file: /home/michael/scm/svn/code.srb2.org/SRB2/vendor/SRB2CBv1.1/bin/Resources/drill.dta
Attempting to load WAD file: /home/michael/scm/svn/code.srb2.org/SRB2/vendor/SRB2CBv1.1/bin/Resources/soar.dta
Attempting to load WAD file: /home/michael/scm/svn/code.srb2.org/SRB2/vendor/SRB2CBv1.1/bin/Resources/SRB2CB.dta
Attempting to load WAD file: /home/michael/scm/svn/code.srb2.org/SRB2/vendor/SRB2CBv1.1/bin/Resources/music.dta
Shutdown tty console
Error: Corrupt game data file.
Delete gamedata.dat(maybe in /home/michael/.srb2)
and try again.
$ CFLAGS=-m32 LDFLAGS=-m32 make LINUX=1
vid_copy.s: Assembler messages:
vid_copy.s:38: Error: invalid instruction suffix for `push'
vid_copy.s:39: Error: invalid instruction suffix for `push'
vid_copy.s:40: Error: invalid instruction suffix for `push'
vid_copy.s:41: Error: invalid instruction suffix for `push'
vid_copy.s:61: Error: invalid instruction suffix for `pop'
vid_copy.s:62: Error: invalid instruction suffix for `pop'
vid_copy.s:63: Error: invalid instruction suffix for `pop'
vid_copy.s:64: Error: invalid instruction suffix for `pop'
make: *** [../objs/Linux/SDL/Release/vid_copy.o] Error 1
$ CFLAGS=-m32 LDFLAGS=-m32 make LINUX=1 NOASM=1
Linking lsdlsrb2...
/usr/bin/ld: skipping incompatible /usr/lib/libSDL.so when searching for -lSDL
/usr/bin/ld: skipping incompatible /usr/lib/libSDL.a when searching for -lSDL
/usr/bin/ld: skipping incompatible /usr/lib/libSDL.so when searching for -lSDL
/usr/bin/ld: skipping incompatible /usr/lib/libSDL.a when searching for -lSDL
/usr/bin/ld: skipping incompatible /usr/lib/libpthread.so when searching for -lpthread
/usr/bin/ld: skipping incompatible /usr/lib/libpthread.a when searching for -lpthread
/usr/bin/ld: skipping incompatible /usr/lib/libpthread.so when searching for -lpthread
/usr/bin/ld: skipping incompatible /usr/lib/libpthread.a when searching for -lpthread
/usr/bin/ld: skipping incompatible /usr/lib/libSDL_mixer.so when searching for -lSDL_mixer
/usr/bin/ld: skipping incompatible /usr/lib/libSDL_mixer.a when searching for -lSDL_mixer
/usr/bin/ld: skipping incompatible /usr/lib/libSDL_mixer.so when searching for -lSDL_mixer
/usr/bin/ld: skipping incompatible /usr/lib/libSDL_mixer.a when searching for -lSDL_mixer
/usr/bin/ld: skipping incompatible /usr/lib/libm.so when searching for -lm
/usr/bin/ld: skipping incompatible /usr/lib/libm.a when searching for -lm
/usr/bin/ld: skipping incompatible /usr/lib/libm.so when searching for -lm
/usr/bin/ld: skipping incompatible /usr/lib/libm.a when searching for -lm
/usr/bin/ld: skipping incompatible /usr/lib/librt.so when searching for -lrt
/usr/bin/ld: skipping incompatible /usr/lib/librt.a when searching for -lrt
/usr/bin/ld: skipping incompatible /usr/lib/librt.so when searching for -lrt
/usr/bin/ld: skipping incompatible /usr/lib/librt.a when searching for -lrt
/usr/bin/ld: skipping incompatible /usr/lib/libGL.so when searching for -lGL
/usr/bin/ld: skipping incompatible /usr/lib/libGL.so when searching for -lGL
/usr/bin/ld: skipping incompatible /usr/lib/libGLU.so when searching for -lGLU
/usr/bin/ld: skipping incompatible /usr/lib/libGLU.so when searching for -lGLU
/usr/bin/ld: skipping incompatible /usr/lib/libpng14.so when searching for -lpng14
/usr/bin/ld: skipping incompatible /usr/lib/libpng14.a when searching for -lpng14
/usr/bin/ld: skipping incompatible /usr/lib/libpng14.so when searching for -lpng14
/usr/bin/ld: skipping incompatible /usr/lib/libpng14.a when searching for -lpng14
/usr/bin/ld: skipping incompatible /usr/lib/libgcc_s.so when searching for -lgcc_s
/usr/bin/ld: skipping incompatible /usr/lib/libgcc_s.so when searching for -lgcc_s
/usr/bin/ld: skipping incompatible /usr/lib/libc.so when searching for -lc
/usr/bin/ld: skipping incompatible /usr/lib/libc.a when searching for -lc
/usr/bin/ld: skipping incompatible /usr/lib/libc.so when searching for -lc
/usr/bin/ld: skipping incompatible /usr/lib/libc.a when searching for -lc
/usr/bin/ld: skipping incompatible /usr/lib/libgcc_s.so when searching for -lgcc_s
/usr/bin/ld: skipping incompatible /usr/lib/libgcc_s.so when searching for -lgcc_s
/usr/bin/ld: i386:x86-64 architecture of input file `../objs/Linux/SDL/Release/string.o' is incompatible with i386 output
/usr/bin/ld: i386:x86-64 architecture of input file `../objs/Linux/SDL/Release/dstrings.o' is incompatible with i386 output
/usr/bin/ld: i386:x86-64 architecture of input file `../objs/Linux/SDL/Release/m_argv.o' is incompatible with i386 output
/usr/bin/ld: i386:x86-64 architecture of input file `../objs/Linux/SDL/Release/m_bbox.o' is incompatible with i386 output
/usr/bin/ld: i386:x86-64 architecture of input file `../objs/Linux/SDL/Release/m_fixed.o' is incompatible with i386 output
/usr/bin/ld: i386:x86-64 architecture of input file `../objs/Linux/SDL/Release/m_random.o' is incompatible with i386 output
/usr/bin/ld: i386:x86-64 architecture of input file `../objs/Linux/SDL/Release/p_maputl.o' is incompatible with i386 output
/usr/bin/ld: i386:x86-64 architecture of input file `../objs/Linux/SDL/Release/tables.o' is incompatible with i386 output
/usr/bin/ld: i386:x86-64 architecture of input file `../objs/Linux/SDL/Release/lzf.o' is incompatible with i386 output
/usr/bin/ld: i386:x86-64 architecture of input file `../objs/Linux/SDL/Release/i_cdmus.o' is incompatible with i386 output
/usr/bin/ld: i386:x86-64 architecture of input file `../objs/Linux/SDL/Release/md5.o' is incompatible with i386 output
/usr/bin/ld: i386:x86-64 architecture of input file `../objs/Linux/SDL/Release/dosstr.o' is incompatible with i386 output
/usr/bin/ld: i386:x86-64 architecture of input file `../objs/Linux/SDL/Release/r_opengl.o' is incompatible with i386 output
/usr/bin/ld: i386:x86-64 architecture of input file `../objs/Linux/SDL/Release/hw_trick.o' is incompatible with i386 output
collect2: ld returned 1 exit status
make: *** [../bin/Linux/Release/lsdlsrb2] Error 1
Did you install the ia32-dev package?