MarkSerin / stardict-3

Automatically exported from code.google.com/p/stardict-3
GNU General Public License v3.0
0 stars 0 forks source link

Unable to compile on Arch Linux #31

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. abs extra/stardict
2. makepkg -s

Compile error:

In file included from lib_res_store.h:24:0,
                 from lib_binary_dict_parser.cpp:45:
libcommon.h:191:50: error: could not convert template argument ‘gzclose’ to 
‘int (*)(void*)’
libcommon.h:191:58: error: invalid type in declaration before ‘;’ token
In file included from lib_res_store.h:24:0,
                 from lib_dict_data_block.cpp:38:
libcommon.h:191:50: error: could not convert template argument ‘gzclose’ to 
‘int (*)(void*)’
libcommon.h:191:58: error: invalid type in declaration before ‘;’ token
In file included from libcommon.cpp:30:0:
libcommon.h:191:50: error: could not convert template argument ‘gzclose’ to 
‘int (*)(void*)’
libcommon.h:191:58: error: invalid type in declaration before ‘;’ token
libcommon.cpp: In function ‘int unpack_zlib(const char*, const char*)’:
libcommon.cpp:602:45: error: invalid conversion from ‘gzFile’ to 
‘zip::gzFile {aka int}’ [-fpermissive]
libcommon.cpp:617:27: error: ‘get_impl’ was not declared in this scope
libcommon.cpp:617:27: note: suggested alternative:
In file included from libcommon.cpp:30:0:
libcommon.h:148:19: note:   ‘get_impl’
make[3]: *** [lib_dict_data_block.lo] Error 1
make[3]: *** Waiting for unfinished jobs....
In file included from ifo_file.h:26:0,
                 from ifo_file.cpp:27:
libcommon.h:191:50: error: could not convert template argument ‘gzclose’ to 
‘int (*)(void*)’
libcommon.h:191:58: error: invalid type in declaration before ‘;’ token
libcommon.cpp: In function ‘std::string create_temp_file()’:
libcommon.cpp:691:20: warning: ignoring return value of ‘ssize_t write(int, 
const void*, size_t)’, declared with attribute warn_unused_result 
[-Wunused-result]

Original issue reported on code.google.com by the.warl...@gmail.com on 10 Jun 2012 at 2:24

GoogleCodeExporter commented 8 years ago
I confirm we have the same problem in Debian Sid.

Original comment by ajq...@gmail.com on 7 Jul 2012 at 10:46

GoogleCodeExporter commented 8 years ago
Subject: Fixed compilation with zlib 1.2.6

--- a/src/libcommon.h
+++ b/src/libcommon.h
@@ -191,7 +191,7 @@
 }

 namespace zip {
-typedef ResourceWrapper<void, void*, int, gzclose> gzFile;
+   typedef ResourceWrapper<struct gzFile_s, struct gzFile_s *, int, gzclose> 
gzFileWrapper;
 }

--- a/src/libcommon.cpp
+++ b/src/libcommon.cpp
@@ -190,7 +190,7 @@

 int unpack_zlib(const char* arch_file_name, const char* out_file_name, print_info_t print_info)
 {
-   zip::gzFile in(gzopen(arch_file_name, "rb"));
+   zip::gzFileWrapper in(gzopen(arch_file_name, "rb"));
    if(!in) {
        print_info("Unable to open archive file %s\n", arch_file_name);
        return EXIT_FAILURE;

Original comment by zhouwei...@gmail.com on 20 Jul 2012 at 9:15

Attachments:

GoogleCodeExporter commented 8 years ago
I downloaded the current version of StarDict in Mercurial and am still seeing 
this compilation problem in Debian 64bit Testing. Are the changes by zhouwei to 
libcommon.cpp and libcommon.h included in Mercurial?

Here is what I see:
root@debamos:~/stardict-3# make
Making all in lib
make[1]: Entering directory `/root/stardict-3/lib'
make  all-recursive
make[2]: Entering directory `/root/stardict-3/lib'
Making all in src
make[3]: Entering directory `/root/stardict-3/lib/src'
/bin/bash ../libtool --tag=CXX   --mode=compile g++ -DHAVE_CONFIG_H -I. -I..  
-Wall -pthread -I/usr/include/gtk-2.0 
-I/usr/lib/x86_64-linux-gnu/gtk-2.0/include -I/usr/include/atk-1.0 
-I/usr/include/gdk-pixbuf-2.0 -I/usr/include/pango-1.0 
-I/usr/include/gio-unix-2.0/ -I/usr/include/glib-2.0 
-I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/pixman-1 
-I/usr/include/freetype2 -I/usr/include/libpng12 -I/usr/include/cairo 
-I/usr/include/libxml2   -I.. -I..   -g -O2 -MT libcommon.lo -MD -MP -MF 
.deps/libcommon.Tpo -c -o libcommon.lo libcommon.cpp
libtool: compile:  g++ -DHAVE_CONFIG_H -I. -I.. -Wall -pthread 
-I/usr/include/gtk-2.0 -I/usr/lib/x86_64-linux-gnu/gtk-2.0/include 
-I/usr/include/atk-1.0 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/pango-1.0 
-I/usr/include/gio-unix-2.0/ -I/usr/include/glib-2.0 
-I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/pixman-1 
-I/usr/include/freetype2 -I/usr/include/libpng12 -I/usr/include/cairo 
-I/usr/include/libxml2 -I.. -I.. -g -O2 -MT libcommon.lo -MD -MP -MF 
.deps/libcommon.Tpo -c libcommon.cpp  -fPIC -DPIC -o .libs/libcommon.o
In file included from libcommon.cpp:30:0:
libcommon.h:191:50: error: could not convert template argument 'gzclose' to 
'int (*)(void*)'
libcommon.h:191:58: error: invalid type in declaration before ';' token
libcommon.cpp: In function 'int unpack_zlib(const char*, const char*)':
libcommon.cpp:602:45: error: invalid conversion from 'gzFile' to 'zip::gzFile 
{aka int}' [-fpermissive]
libcommon.cpp:617:27: error: 'get_impl' was not declared in this scope
libcommon.cpp:617:27: note: suggested alternative:
libcommon.h:148:19: note:   'get_impl'
make[3]: *** [libcommon.lo] Error 1
make[3]: Leaving directory `/root/stardict-3/lib/src'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/root/stardict-3/lib'
make[1]: *** [all] Error 2
make[1]: Leaving directory `/root/stardict-3/lib'
make: *** [all-recursive] Error 1 

Original comment by amosba...@gmail.com on 6 Nov 2012 at 4:54

GoogleCodeExporter commented 8 years ago
Try use `abs` instead, I've submitted the patches to the Arch repository for a 
while

Original comment by the.warl...@gmail.com on 6 Nov 2012 at 11:46

GoogleCodeExporter commented 8 years ago
Fixed. Patch merged!

Original comment by huzheng...@gmail.com on 17 Apr 2013 at 3:13