Text archives Help
- From: <ajp.wang@gmail.com>
- To: iv3d-users@sci.utah.edu
- Subject: [IV3D-USERS] Re: Re: Re: Re: Build problem by dynamic link to Qt
- Date: Wed, 16 Mar 2011 19:43:43 -0600 (MDT)
OK. Only gzdirect() is missing in Qt DLLs (a bug in Qt 4.7.2 ?), gzdirect is
only used in IsZipped(), so we can directly rewrite gzdirect (see
StandaloneTuvok\3rdParty\gzio.c) in IASSConverter.cpp :
Replace IsZipped() by
typedef struct gz_stream {
z_stream stream;
int z_err; /* error code for last stream operation */
int z_eof; /* set if end of input file */
FILE *file; /* .gz file */
Byte *inbuf; /* input buffer */
Byte *outbuf; /* output buffer */
uLong crc; /* crc32 of uncompressed data */
char *msg; /* error message */
char *path; /* path name for debugging only */
int transparent; /* 1 if input file is not a .gz file */
char mode; /* 'w' or 'r' */
z_off_t start; /* start of compressed data in file (header skipped) */
z_off_t in; /* bytes into deflate or inflate */
z_off_t out; /* bytes out of deflate or inflate */
int back; /* one character push-back */
int last; /* true if push-back is last character */
} gz_stream;
int ZEXPORT gzdirect_local (gzFile file)
{
gz_stream *s = (gz_stream*)file;
if (s == NULL || s->mode != 'r') return 0;
return s->transparent;
}
bool
IASSConverter::IsZipped(const std::string& strFile)
{
#ifdef TUVOK_NO_ZLIB
T_ERROR("No zlib support! Faking this...");
return false;
#else
gzFile file = gzopen(strFile.c_str(), "rb");
if (file==0)
return false;
int rt = gzdirect_local(file); //gzdirect renamed
gzclose(file);
return rt == 1 ? false : true;
#endif
}
Then no need to change compiling options except adding "4" for Qt library
names. Building with dynamic linking to Qt works now.
Cheers,
Alex
- [IV3D-USERS] Re: Re: Re: Re: Build problem by dynamic link to Qt, ajp.wang, 03/16/2011
Archive powered by MHonArc 2.6.16.