soshial / xdxf_makedict

XDXF — an open and free dictionary format, that stores word articles in a structural and semantic way. The most convertible format
227 stars 54 forks source link

Can not compile xdxf_makedict on Mac OS X 10.8.4 #13

Closed pengyu closed 5 years ago

pengyu commented 11 years ago

I get the following errors when I try to compile xdxf_makedict. Has anybody tested it on Mac OS?

~/dvcs_src/xdxf_makedict$ cd ..
~/dvcs_src$ mkdir xdxf_makedict_build
~/dvcs_src$ cd xdxf_makedict_build
~/dvcs_src/xdxf_makedict_build$ dir
~/dvcs_src/xdxf_makedict_build$ cmake ../xdxf_makedict
-- The C compiler identification is Clang 4.1.0
-- The CXX compiler identification is Clang 4.1.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Found PkgConfig: /opt/local/bin/pkg-config (found version "0.28") 
-- checking for one of the modules 'glib-2.0'
-- Found GLib2: glib-2.0;intl /opt/local/include/glib-2.0;/opt/local/lib/glib-2.0/include
-- Looking for include file glib/gregex.h
-- Looking for include file glib/gregex.h - not found
-- Found ZLIB: /usr/lib/libz.dylib (found version "1.2.5") 
-- Found Gettext: /opt/local/bin/msgmerge (found version "0.18.3") 
-- Performing Test ICONV_HAVE_WERROR
-- Performing Test ICONV_HAVE_WERROR - Success
-- Performing Test ICONV_SECOND_ARGUMENT_IS_CONST
-- Performing Test ICONV_SECOND_ARGUMENT_IS_CONST - Failed
-- Found Iconv: /usr/lib/libiconv.dylib
-- Looking for dgettext
-- Looking for dgettext - not found
-- Found libintl: /opt/local/lib/libintl.dylib
-- Looking for mmap
-- Looking for mmap - found
-- Looking for locale.h
-- Looking for locale.h - found
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/py/dvcs_src/xdxf_makedict_build
~/dvcs_src/xdxf_makedict_build$ check
checkRandomLinesExist.py  check_dylib               checkcites                checkgid                  checknr                   checkrad                  checksyms                 
~/dvcs_src/xdxf_makedict_build$ check
checkRandomLinesExist.py  check_dylib               checkcites                checkgid                  checknr                   checkrad                  checksyms                 
~/dvcs_src/xdxf_makedict_build$ make checkinstall
make: *** No rule to make target `checkinstall'.  Stop.
~/dvcs_src/xdxf_makedict_build$ make -j8
Scanning dependencies of target makedict
[  3%] [  7%] [ 11%] [ 15%] Building CXX object CMakeFiles/makedict.dir/src/file.cpp.o
Building CXX object CMakeFiles/makedict.dir/src/makedict.cpp.o
[ 19%] Building CXX object CMakeFiles/makedict.dir/src/generator.cpp.o
[ 23%] Building CXX object CMakeFiles/makedict.dir/src/parser.cpp.o
Building CXX object CMakeFiles/makedict.dir/src/process.cpp.o
[ 30%] [ 30%] Building CXX object CMakeFiles/makedict.dir/src/connector.cpp.o
Building CXX object CMakeFiles/makedict.dir/src/utils.cpp.o
Building CXX object CMakeFiles/makedict.dir/src/log.cpp.o
In file included from /Users/py/dvcs_src/xdxf_makedict/src/parser.cpp:32:
In file included from /Users/py/dvcs_src/xdxf_makedict/src/utils.hpp:4:
In file included from /usr/include/c++/4.2.1/algorithm:64:
In file included from /usr/include/c++/4.2.1/bits/stl_algobase.h:70:
In file included from /usr/include/c++/4.2.1/iosfwd:44:
/usr/include/c++/4.2.1/bits/c++locale.h:66:24: error: no member named 'libintl_setlocale' in namespace 'std'
    char* __old = std::setlocale(LC_NUMERIC, NULL);
                  ~~~~~^
/opt/local/include/libintl.h:432:19: note: expanded from macro 'setlocale'
#define setlocale libintl_setlocale
                  ^
In file included from /Users/py/dvcs_src/xdxf_makedict/src/parser.cpp:32:
In file included from /Users/py/dvcs_src/xdxf_makedict/src/utils.hpp:4:
In file included from /usr/include/c++/4.2.1/algorithm:64:
In file included from /usr/include/c++/4.2.1/bits/stl_algobase.h:70:
In file included from /usr/include/c++/4.2.1/iosfwd:44:
/usr/include/c++/4.2.1/bits/c++locale.h:72:7: error: no member named 'libintl_setlocale' in namespace 'std'
        std::setlocale(LC_NUMERIC, "C");
        ~~~~~^
/opt/local/include/libintl.h:432:19: note: expanded from macro 'setlocale'
#define setlocale libintl_setlocale
                  ^
In file included from /Users/py/dvcs_src/xdxf_makedict/src/parser.cpp:32:
In file included from /Users/py/dvcs_src/xdxf_makedict/src/utils.hpp:4:
In file included from /usr/include/c++/4.2.1/algorithm:64:
In file included from /usr/include/c++/4.2.1/bits/stl_algobase.h:70:
In file included from /usr/include/c++/4.2.1/iosfwd:44:
/usr/include/c++/4.2.1/bits/c++locale.h:88:7: error: no member named 'libintl_setlocale' in namespace 'std'
        std::setlocale(LC_NUMERIC, __sav);
        ~~~~~^
/opt/local/include/libintl.h:432:19: note: expanded from macro 'setlocale'
#define setlocale libintl_setlocale
                  ^
In file included from /Users/py/dvcs_src/xdxf_makedict/src/makedict.cpp:34:
In file included from /usr/include/c++/4.2.1/map:64:
In file included from /usr/include/c++/4.2.1/bits/stl_tree.h:68:
In file included from /usr/include/c++/4.2.1/bits/stl_algobase.h:70:
In file included from /usr/include/c++/4.2.1/iosfwd:44:
/usr/include/c++/4.2.1/bits/c++locale.h:66:24: error: no member named 'libintl_setlocale' in namespace 'std'
    char* __old = std::setlocale(LC_NUMERIC, NULL);
                  ~~~~~^
/opt/local/include/libintl.h:432:19: note: expanded from macro 'setlocale'
#define setlocale libintl_setlocale
                  ^
In file included from /Users/py/dvcs_src/xdxf_makedict/src/makedict.cpp:34:
In file included from /usr/include/c++/4.2.1/map:64:
In file included from /usr/include/c++/4.2.1/bits/stl_tree.h:68:
In file included from /usr/include/c++/4.2.1/bits/stl_algobase.h:70:
In file included from /usr/include/c++/4.2.1/iosfwd:44:
/usr/include/c++/4.2.1/bits/c++locale.h:72:7: error: no member named 'libintl_setlocale' in namespace 'std'
        std::setlocale(LC_NUMERIC, "C");
        ~~~~~^
/opt/local/include/libintl.h:432:19: note: expanded from macro 'setlocale'
#define setlocale libintl_setlocale
                  ^
In file included from /Users/py/dvcs_src/xdxf_makedict/src/makedict.cpp:34:
In file included from /usr/include/c++/4.2.1/map:64:
In file included from /usr/include/c++/4.2.1/bits/stl_tree.h:68:
In file included from /usr/include/c++/4.2.1/bits/stl_algobase.h:70:
In file included from /usr/include/c++/4.2.1/iosfwd:44:
/usr/include/c++/4.2.1/bits/c++locale.h:88:7: error: no member named 'libintl_setlocale' in namespace 'std'
        std::setlocale(LC_NUMERIC, __sav);
        ~~~~~^
/opt/local/include/libintl.h:432:19: note: expanded from macro 'setlocale'
#define setlocale libintl_setlocale
                  ^
In file included from /Users/py/dvcs_src/xdxf_makedict/src/generator.cpp:33:
In file included from /usr/include/c++/4.2.1/numeric:66:
In file included from /usr/include/c++/4.2.1/iterator:69:
In file included from /usr/include/c++/4.2.1/ostream:44:
In file included from /usr/include/c++/4.2.1/ios:42:
In file included from /usr/include/c++/4.2.1/iosfwd:44:
/usr/include/c++/4.2.1/bits/c++locale.h:66:24: error: no member named 'libintl_setlocale' in namespace 'std'
    char* __old = std::setlocale(LC_NUMERIC, NULL);
                  ~~~~~^
/opt/local/include/libintl.h:432:19: note: expanded from macro 'setlocale'
#define setlocale libintl_setlocale
                  ^
In file included from /Users/py/dvcs_src/xdxf_makedict/src/generator.cpp:33:
In file included from /usr/include/c++/4.2.1/numeric:66:
In file included from /usr/include/c++/4.2.1/iterator:69:
In file included from /usr/include/c++/4.2.1/ostream:44:
In file included from /usr/include/c++/4.2.1/ios:42:
In file included from /usr/include/c++/4.2.1/iosfwd:44:
/usr/include/c++/4.2.1/bits/c++locale.h:72:7: error: no member named 'libintl_setlocale' in namespace 'std'
        std::setlocale(LC_NUMERIC, "C");
        ~~~~~^
/opt/local/include/libintl.h:432:19: note: expanded from macro 'setlocale'
#define setlocale libintl_setlocale
                  ^
In file included from /Users/py/dvcs_src/xdxf_makedict/src/generator.cpp:33:
In file included from /usr/include/c++/4.2.1/numeric:66:
In file included from /usr/include/c++/4.2.1/iterator:69:
In file included from /usr/include/c++/4.2.1/ostream:44:
In file included from /usr/include/c++/4.2.1/ios:42:
In file included from /usr/include/c++/4.2.1/iosfwd:44:
/usr/include/c++/4.2.1/bits/c++locale.h:88:7: error: no member named 'libintl_setlocale' in namespace 'std'
        std::setlocale(LC_NUMERIC, __sav);
        ~~~~~^
/opt/local/include/libintl.h:432:19: note: expanded from macro 'setlocale'
#define setlocale libintl_setlocale
                  ^
[ 34%] [ 38%] Building CXX object CMakeFiles/makedict.dir/src/xml.cpp.o
Building CXX object CMakeFiles/makedict.dir/src/charset_conv.cpp.o
[ 42%] 3 errors generated.
make[2]: *** [CMakeFiles/makedict.dir/src/parser.cpp.o] Error 1
make[2]: *** Waiting for unfinished jobs....
Building CXX object CMakeFiles/makedict.dir/src/dictd_generator.cpp.o
[ 46%] Building CXX object CMakeFiles/makedict.dir/src/dictd_parser.cpp.o
3 errors generated.
make[2]: *** [CMakeFiles/makedict.dir/src/makedict.cpp.o] Error 1
3 errors generated.
make[2]: *** [CMakeFiles/makedict.dir/src/generator.cpp.o] Error 1
/Users/py/dvcs_src/xdxf_makedict/src/charset_conv.cpp:107:5: warning: add explicit braces to avoid dangling else [-Wdangling-else]
                } else {
                  ^
1 warning generated.
make[1]: *** [CMakeFiles/makedict.dir/all] Error 2
make: *** [all] Error 2
twardoch commented 10 years ago
  1. Install libintl from http://rudix.org/packages/libintl.html
  2. Add #include to file.hpp in xdxf_makedict/src
mshkrebtan commented 7 years ago

I have compiled makedict against macOS Sierra 10.12.3.

First, I installed cmake and gettext via Homebrew:

brew install cmake gettext

Then I installed libintl from Rudix.org.

Then there is a bug #15. You have to include cstdlib in src/file.hpp:

diff --git a/src/file.hpp b/src/file.hpp
index e9f714b..be8d925 100644
--- a/src/file.hpp
+++ b/src/file.hpp
@@ -3,6 +3,7 @@

 #include <cstdio>
 #include <string>
+#include <cstdlib>

 /**
  * Wrapper around FILE, because of std::fstream can not

patch.diff.zip

After that:

export PATH="/usr/local/opt/gettext/bin:$PATH"
cd xdxf_makedict
cmake .
make
sudo make install
soshial commented 5 years ago

I am closing the issue, because the converter has been deprecated. Please use other converters like pyglossary.