build error when compiling ark libzip plugin
Orville Bennett
illogical1 at gmail.com
Sat Jan 31 10:49:33 CET 2009
I had some trouble when enabling zip support in ark. Reason seems to
be "off_t" defined in
both /usr/include/sys/types.h and kdeutils-4.2.0/ark/plugins/
libzipplugin/zipplugin.cpp.
zipplugin.cpp block
#ifdef LIBZIP_COMPILED_WITH_32BIT_OFF_T
#define __off_t_defined
typedef quint32 off_t;
#endif /* LIBZIP_COMPILED_WITH_32BIT_OFF_T */
types.h block
#ifndef _OFF_T
typedef __darwin_off_t off_t;
#define _OFF_T
#endif
This thread convinced me the definition in zipplugin.cpp was
unnecessary http://lists.apple.com/archives/Scitech/2006/Sep/msg00071.html
which lead to this change in kdeutils-4.2.0/ark/plugins/libzipplugin/
CMakeLists.txt
@@ -4,11 +4,11 @@
${CMAKE_CURRENT_BINARY_DIR}/../..
)
-if(WIN32)
+if(APPLE OR WIN32)
set (LIBZIP_COMPILED_WITH_32BIT_OFF_T OFF CACHE BOOL "Whether
the system libzip library is compiled with 32bits off_t" )
-else(WIN32)
+else(APPLE OR WIN32)
set (LIBZIP_COMPILED_WITH_32BIT_OFF_T ON CACHE BOOL "Whether the
system libzip library is compiled with 32bits off_t" )
-endif(WIN32)
+endif(APPLE OR WIN32)
if (LIBZIP_COMPILED_WITH_32BIT_OFF_T)
Partial error below:
[ 8%] Building CXX object
-D__APPLE_KDE__ -D_LARGEFILE64_SOURCE -o CMakeFiles/
kerfuffle_libzip.dir/zipplugin.o -c /opt/local/var/macports/build/
_Users_orville_Source_macports-trunk_dports_kde_kdeutils4/work/
kdeutils-4.2.0/ark/plugins/libzipplugin/zipplugin.cpp
In file included from /opt/local/include/kglobal.h:24,
from /opt/local/include/kiconloader.h:29,
from /opt/local/include/kio/global.h:29,
from /opt/local/include/kio/jobclasses.h:30,
from /opt/local/include/kio/job.h:25,
from /opt/local/var/macports/build/
_Users_orville_Source_macports-trunk_dports_kde_kdeutils4/work/
kdeutils-4.2.0/ark/plugins/libzipplugin/../../kerfuffle/
archiveinterface.h:37,
from /opt/local/var/macports/build/
_Users_orville_Source_macports-trunk_dports_kde_kdeutils4/work/
kdeutils-4.2.0/ark/plugins/libzipplugin/zipplugin.cpp:37:
/usr/include/sys/types.h:172: error: conflicting declaration ‘typedef
__darwin_off_t off_t’
/opt/local/var/macports/build/_Users_orville_Source_macports-
trunk_dports_kde_kdeutils4/work/kdeutils-4.2.0/ark/plugins/
libzipplugin/zipplugin.cpp:32: error: ‘off_t’ has a previous
declaration as ‘typedef quint32 off_t’
make[2]: *** [ark/plugins/libzipplugin/CMakeFiles/kerfuffle_libzip.dir/
zipplugin.o] Error 1
make[1]: *** [ark/plugins/libzipplugin/CMakeFiles/kerfuffle_libzip.dir/
all] Error 2
make: *** [all] Error 2
Was that too wordy? I think so.
More information about the Kde-buildsystem
mailing list