I have also hit this compilation issue, also on an old RedHat system. Looking in the sources for the file libclamav/7z/Types.h for 0.97.8 there are some edits that seem to be working around this issue which don't appear in the corresponding Types.h file for 0.98. The diff output is a bit long so here are the relevant bits...

at line 13

/* aCaB -- lame workaround for "Byte" refef */
#include <zconf.h>

at line 46

/* aCaB -- use Byte defined in zconf.h
typedef unsigned char Byte;
*/

making these changes to the Types.h file with 0.98 enables the compile to complete.

I have compiled 0.98 on CentOS6.4 without issues so this is probably related to the gcc version or some such.

FAS


Bob Cobb wrote:
Richard,

I'm using RH8 because it's the one production server that needs to stay online. 
 Unfortunately I can't take it offline to upgrade to CentOS.


Shawn,

Tried configure without "--with-zlib=/usr/local" and I got the same error.

B.

----------------------------------------
Date: Fri, 20 Sep 2013 11:24:26 -0400
From: sw...@sourcefire.com
To: clamav-users@lists.clamav.net
Subject: Re: [clamav-users] Compiler error: 7z/Types.h:58: redefinition of 
`Byte'

On Fri, Sep 20, 2013 at 10:38 AM, Bob Cobb <bobcob...@hotmail.com> wrote:

After downloading ClamAV 0.98 I tried to compile it, but I got this error,


In file included from 7z/LzmaDec.h:7,
from lzma_iface.h:26,
from upx.c:59:
7z/Types.h:58: redefinition of `Byte'
/usr/local/include/zconf.h:368: `Byte' previously declared here
make[4]: *** [libclamav_la-upx.lo] Error 1
make[4]: Leaving directory `/home/clamav/clamav-0.98/libclamav'
make[3]: *** [all-recursive] Error 1
make[3]: Leaving directory `/home/clamav/clamav-0.98/libclamav'
make[2]: *** [all] Error 2
make[2]: Leaving directory `/home/clamav/clamav-0.98/libclamav'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/clamav/clamav-0.98'
make: *** [all] Error 2


Here's what I'm using,

gcc version 3.2 20020903 (Red Hat Linux 8.0 3.2-7)

./configure --enable-bigstack --enable-readdir_r --with-zlib=/usr/local
--with-libcurl --enable-no-cache --enable-milter --enable-dns-fix
--enable-clamdtop

I tried this work around, which allowed me to compile it,

(in clamav-0.98/libclamav/7z/Types.h line 59)

replaced this,
typedef unsigned char Byte;

with this,
#define Byte unsigned char

I don't know if it's safe to use, so I held off installing it. Also, I
didn't have any problems compiling the previous version of ClamAV
(0.97.8). Any help would be appreciated.

Thanks,

B.


Hey Bob,

Is there a reason why you're specifying --with-zlib? Can you give it a try
without that?

Thanks,

Shawn
_______________________________________________
Help us build a comprehensive ClamAV guide: visit http://wiki.clamav.net
http://www.clamav.net/support/ml                                        
_______________________________________________
Help us build a comprehensive ClamAV guide: visit http://wiki.clamav.net
http://www.clamav.net/support/ml

_______________________________________________
Help us build a comprehensive ClamAV guide: visit http://wiki.clamav.net
http://www.clamav.net/support/ml

Reply via email to