I am using CodeSynthesis XSD (XML Data Binding Tool for C++) to auto-generate .hpp and .cpp files from a .xsd file. But when running xsd over my .xsd file, I am getting this error:
Could not load a transcoding service
I am using openSUSE Leap-42.2, Xsd 4.0 and Apache Xercess 3.1.4. Here are the detailed message:
Scanning dependencies of target XSDModel
[ 2%] Generating C++/XML mapping
Could not load a transcoding service
lib/CMakeFiles/XSDModel.dir/build.make:51: recipe for target 'src/model/Model.cpp' failed
make[2]: *** [src/model/Model.cpp] Error 255
CMakeFiles/Makefile2:76: recipe for target 'lib/CMakeFiles/XSDModel.dir/all' failed
make[1]: *** [lib/CMakeFiles/XSDModel.dir/all] Error 2
Makefile:127: recipe for target 'all' failed
make: *** [all] Error 2
[ 2%] Generating C++/XML mapping
Could not load a transcoding service
lib/CMakeFiles/XSDModel.dir/build.make:51: recipe for target 'src/model/Model.cpp' failed
make[2]: *** [src/model/Model.cpp] Error 255
CMakeFiles/Makefile2:76: recipe for target 'lib/CMakeFiles/XSDModel.dir/all' failed
make[1]: *** [lib/CMakeFiles/XSDModel.dir/all] Error 2
Makefile:127: recipe for target 'all' failed
make: *** [all] Error 2
Edit 1:
I've built Apache Xercess with --enable-transcoder-gnuiconv
switch and iconv
is installed on my machine as well.
Edit 2:
After some digging, I found that the echo $LANG
command on my linux prints an empty line. In addition, running localedef -i en_US -f UTF-8 en_US.UTF-8
prints this error:
character map file `UTF-8' not found: No such file or directory
cannot read character map directory `/usr/share/i18n/charmaps': No such file or directory
No locale has been defined on this linux. So, simply set a locale:
$ export LANG=en_US.UTF-8
and afterwards, everything will be fine.