problems compiling snes9x/zsnes

jhu

Lifer
Oct 10, 1999
11,918
9
81
compilng works up until gcc starts compiling the unzipping code in the unzip directory. the error i get appears as follows:

In file included from zip/zzip.c:35:
zip/unzip.h:114: parse error before `unzStringFileNameCompare'
zip/unzip.h:116: warning: type defaults to `int' in declaration of `unzStringFileNameCompare'
zip/unzip.h:116: warning: data definition has no type or storage class

so what's on line 114 in unzip.h is:

extern int ZEXPORT unzStringFileNameCompare OF ((const char* fileName1,
const char* fileName2,
int iCaseSensitivity));

in fact, pretty much all the lines after that produce give the same message. i hate these compiling problems
 

jhu

Lifer
Oct 10, 1999
11,918
9
81
they're just structure definitions:

/* unz_file_info contain information about a file in the zipfile */
typedef struct unz_file_info_s
{
uLong version; /* version made by 2 bytes */
uLong version_needed; /* version needed to extract 2 bytes */
uLong flag; /* general purpose bit flag 2 bytes */
uLong compression_method; /* compression method 2 bytes */
uLong dosDate; /* last mod file date in Dos fmt 4 bytes */
uLong crc; /* crc-32 4 bytes */
uLong compressed_size; /* compressed size 4 bytes */
uLong uncompressed_size; /* uncompressed size 4 bytes */
uLong size_filename; /* filename length 2 bytes */
uLong size_file_extra; /* extra field length 2 bytes */
uLong size_file_comment; /* file comment length 2 bytes */

uLong disk_num_start; /* disk number start 2 bytes */
uLong internal_fa; /* internal file attributes 2 bytes */
uLong external_fa; /* external file attributes 4 bytes */

tm_unz tmu_date;
} unz_file_info;

here's where the line where compiling gives errors
extern int ZEXPORT unzStringFileNameCompare OF ((const char* fileName1,
const char* fileName2,
int iCaseSensitivity));
/*
Compare two filename (fileName1,fileName2).
If iCaseSenisivity = 1, comparision is case sensitivity (like strcmp)
If iCaseSenisivity = 2, comparision is not case sensitivity (like strcmpi
or strcasecmp)
If iCaseSenisivity = 0, case sensitivity is defaut of your operating system
(like 1 on Unix, 2 on Windows)
*/

 

MGMorden

Diamond Member
Jul 4, 2000
3,348
0
76
It's a preprocessor definition (looking through the code now). I hate preprocessor defs and typedefs for this same reason (code isn't instantly recognizable to anyone but the person who wrote it). I'm going to keep checking this out for a bit to see if I can find out what needs to be done (I think I'm one of those rare few who like looking over code :)).
 

MGMorden

Diamond Member
Jul 4, 2000
3,348
0
76
This is a cheesy workaround but it does work . . . . go into the zsnes-whatever/src/zip directory and compile the code to object files yourself ( type 'gcc -c *.c'). They seem to compile fine from here. Then go back to src/ and run make. It'll see the object files as newer than Makefile and their source files and will skip them. Everything else compiles and links fine from here (just make sure you have nasm installed or the assembly language stuff won't get compiled). Just do a standard 'make install' and enjoy.
 

Elledan

Banned
Jul 24, 2000
8,880
0
0
Glad to hear it worked out :)

And yes, I think you're one of the few people who actually enjoy reading through code someone else has written ;)
 

jhu

Lifer
Oct 10, 1999
11,918
9
81
thanks for the help guys. i also found out that if i just deleted any reference to ZEXPORT in the unzip directory it would compile correctly too.
 

Elledan

Banned
Jul 24, 2000
8,880
0
0


<< thanks for the help guys. i also found out that if i just deleted any reference to ZEXPORT in the unzip directory it would compile correctly too. >>


Whoa! Now that's why I call 'weird' =)

You tried contacting the authors?