Discussion:
[sword-devel] Help needed to build Sword Python binding on Windows
R Johnson
2014-09-02 01:03:46 UTC
Permalink
Hello all,

Today is Labor Day (in the US), and I haven't heard anything about my
thread "Building Python binding to Sword on Windows returns exit code 1"
since around Memorial Day (May 26) weekend. I'm disappointed by this,
because I can't continue working on the Bible software I was attempting
to write until I can get the binding built on Windows. I apologize if I
offended anyone.

Since I posted my last message, I have upgraded to Sword 1.7.3.dev3138,
CMake 3.0.1, and SWIG 3.0.2, which I think fixed one or two of the
errors I was getting, but I still am not able to successfully build the
Python bindings. I have attached the output logs (abridged) from Visual
Studio. The first one is from trying to build the entire libsword
solution, and the second one is from trying to rebuild the swordswig
subproject (after moving "Sword.lib" from the "Release" subdirectory to
the top-level "sword-build" directory).

I'm experienced with Python programming, but know very little C++, so
regrettably I'm not able to detect and fix the problems myself. I would
really appreciate further help with this. Thank you.

-- Timothy
-------------- next part --------------
1>------ Build started: Project: ZERO_CHECK, Configuration: Release Win32 ------
...
3>------ Build started: Project: sword, Configuration: Release Win32 ------
...
3> Creating library C:/Documents and Settings/Timothy/My Documents/Sword/sword-build/Release/sword.lib and object C:/Documents and Settings/Timothy/My Documents/Sword/sword-build/Release/sword.exp
3>LINK : fatal error LNK1104: cannot open file 'C:/Documents and Settings/Timothy/My Documents/Sword/sword-build/Release/sword.lib'
...
6>------ Build started: Project: swordswig, Configuration: Release Win32 ------
...
6> C:\Program Files\Microsoft Visual Studio 10.0\VC\BIN\link.exe /DLL /nologo /INCREMENTAL:NO "/LIBPATH:C:/Documents and Settings/Timothy/My Documents/Sword/sword-build" /LIBPATH:C:\Python34\libs /LIBPATH:C:\Python34\PCbuild sword.lib /EXPORT:PyInit__Sword build\temp.win32-3.4\Release\Sword.obj /OUT:build\lib.win32-3.4\_Sword.pyd /IMPLIB:build\temp.win32-3.4\Release\_Sword.lib /MANIFESTFILE:build\temp.win32-3.4\Release\_Sword.pyd.manifest
6>LINK : fatal error LNK1181: cannot open input file 'sword.lib'
...
========== Build: 32 succeeded, 2 failed, 0 up-to-date, 1 skipped ==========
-------------- next part --------------
1>------ Build started: Project: ZERO_CHECK, Configuration: Release Win32 ------
...
3>------ Build started: Project: swordswig, Configuration: Release Win32 ------
3> Building Custom Rule C:/Documents and Settings/Timothy/My Documents/Sword/sword/bindings/swig/python/CMakeLists.txt
3> CMake does not need to re-run because C:\Documents and Settings\Timothy\My Documents\Sword\sword-build\bindings\swig\python\CMakeFiles\generate.stamp is up-to-date.
3> Generating Sword.cxx
3>C:\Documents and Settings\Timothy\My Documents\Sword\sword\include\versekey.h(86): warning 325: Nested struct not currently supported (VerseComponents ignored)
3>C:\Documents and Settings\Timothy\My Documents\Sword\sword\include\versificationmgr.h(125): warning 325: Nested class not currently supported (Book ignored)
...
3>C:\Documents and Settings\Timothy\My Documents\Sword\sword\include\swkey.h(227): warning 503: Can't wrap 'operator const char*' unless renamed to a valid identifier.
3> running build
3> running build_py
3> copying Sword.py -> build\lib.win32-3.4
3> running build_ext
3> building '_Sword' extension
3> C:\Program Files\Microsoft Visual Studio 10.0\VC\BIN\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG "-IC:/Documents and Settings/Timothy/My Documents/Sword/sword/bindings/swig/python" "-IC:/Documents and Settings/Timothy/My Documents/Sword/sword/include" "-IC:/Documents and Settings/Timothy/My Documents/Sword/sword/bindings/swig/python/.." "-IC:/Documents and Settings/Timothy/My Documents/Sword/sword/bindings/swig/python../../" -IC:\Python34\include -IC:\Python34\include /TpSword.cxx /Fobuild\temp.win32-3.4\Release\Sword.obj
3> Sword.cxx
3>C:\Program Files\Microsoft Visual Studio 10.0\VC\INCLUDE\xlocale(323): warning C4530: C++ exception handler used, but unwind semantics are not enabled. Specify /EHsc
3>c:\documents and settings\timothy\my documents\sword\sword-build\bindings\swig\python\Sword.h(231): warning C4996: 'sword::StatusReporter::statusUpdate': ** WARNING: deprecated method **
...
3>Sword.cxx(7759): warning C4101: 'e' : unreferenced local variable
...
3>Sword.cxx(80760): warning C4800: 'const char *' : forcing value to bool 'true' or 'false' (performance warning)
3>Sword.cxx(81015): warning C4101: 'e' : unreferenced local variable
...
3> C:\Program Files\Microsoft Visual Studio 10.0\VC\BIN\link.exe /DLL /nologo /INCREMENTAL:NO "/LIBPATH:C:/Documents and Settings/Timothy/My Documents/Sword/sword-build" /LIBPATH:C:\Python34\libs /LIBPATH:C:\Python34\PCbuild sword.lib /EXPORT:PyInit__Sword build\temp.win32-3.4\Release\Sword.obj /OUT:build\lib.win32-3.4\_Sword.pyd /IMPLIB:build\temp.win32-3.4\Release\_Sword.lib /MANIFESTFILE:build\temp.win32-3.4\Release\_Sword.pyd.manifest
3> Creating library build\temp.win32-3.4\Release\_Sword.lib and object build\temp.win32-3.4\Release\_Sword.exp
3>sword.lib(utf8nfkd.obj) : error LNK2001: unresolved external symbol _ucnv_open_53
3>sword.lib(utf8bidireorder.obj) : error LNK2019: unresolved external symbol _ucnv_open_53 referenced in function "public: __thiscall sword::UTF8BiDiReorder::UTF8BiDiReorder(void)" (??0UTF8BiDiReorder at sword@@QAE at XZ)
3>sword.lib(scsuutf8.obj) : error LNK2001: unresolved external symbol _ucnv_open_53
3>sword.lib(utf8scsu.obj) : error LNK2001: unresolved external symbol _ucnv_open_53
3>sword.lib(utf8transliterator.obj) : error LNK2001: unresolved external symbol _ucnv_open_53
3>sword.lib(utf8nfkd.obj) : error LNK2001: unresolved external symbol _ucnv_close_53
3>sword.lib(utf8bidireorder.obj) : error LNK2019: unresolved external symbol _ucnv_close_53 referenced in function "public: virtual __thiscall sword::UTF8BiDiReorder::~UTF8BiDiReorder(void)" (??1UTF8BiDiReorder at sword@@UAE at XZ)
3>sword.lib(scsuutf8.obj) : error LNK2001: unresolved external symbol _ucnv_close_53
3>sword.lib(utf8scsu.obj) : error LNK2001: unresolved external symbol _ucnv_close_53
3>sword.lib(utf8transliterator.obj) : error LNK2001: unresolved external symbol _ucnv_close_53
3>sword.lib(utf8bidireorder.obj) : error LNK2019: unresolved external symbol _ucnv_fromUChars_53 referenced in function "public: virtual char __thiscall sword::UTF8BiDiReorder::processText(class sword::SWBuf &,class sword::SWKey const *,class sword::SWModule const *)" (?processText at ***@sword@@UAEDAAVSWBuf at ***@PBVSWKey at ***@PBVSWModule at 2@@Z)
3>sword.lib(utf8transliterator.obj) : error LNK2001: unresolved external symbol _ucnv_fromUChars_53
3>sword.lib(utf8nfkd.obj) : error LNK2001: unresolved external symbol _ucnv_fromUChars_53
3>sword.lib(utf8bidireorder.obj) : error LNK2019: unresolved external symbol _ubidi_close_53 referenced in function "public: virtual char __thiscall sword::UTF8BiDiReorder::processText(class sword::SWBuf &,class sword::SWKey const *,class sword::SWModule const *)" (?processText at ***@sword@@UAEDAAVSWBuf at ***@PBVSWKey at ***@PBVSWModule at 2@@Z)
3>sword.lib(utf8bidireorder.obj) : error LNK2019: unresolved external symbol _ubidi_writeReordered_53 referenced in function "public: virtual char __thiscall sword::UTF8BiDiReorder::processText(class sword::SWBuf &,class sword::SWKey const *,class sword::SWModule const *)" (?processText at ***@sword@@UAEDAAVSWBuf at ***@PBVSWKey at ***@PBVSWModule at 2@@Z)
3>sword.lib(utf8bidireorder.obj) : error LNK2019: unresolved external symbol _ubidi_setPara_53 referenced in function "public: virtual char __thiscall sword::UTF8BiDiReorder::processText(class sword::SWBuf &,class sword::SWKey const *,class sword::SWModule const *)" (?processText at ***@sword@@UAEDAAVSWBuf at ***@PBVSWKey at ***@PBVSWModule at 2@@Z)
3>sword.lib(utf8bidireorder.obj) : error LNK2019: unresolved external symbol _ubidi_openSized_53 referenced in function "public: virtual char __thiscall sword::UTF8BiDiReorder::processText(class sword::SWBuf &,class sword::SWKey const *,class sword::SWModule const *)" (?processText at ***@sword@@UAEDAAVSWBuf at ***@PBVSWKey at ***@PBVSWModule at 2@@Z)
3>sword.lib(utf8bidireorder.obj) : error LNK2019: unresolved external symbol _ucnv_toUChars_53 referenced in function "public: virtual char __thiscall sword::UTF8BiDiReorder::processText(class sword::SWBuf &,class sword::SWKey const *,class sword::SWModule const *)" (?processText at ***@sword@@UAEDAAVSWBuf at ***@PBVSWKey at ***@PBVSWModule at 2@@Z)
3>sword.lib(utf8transliterator.obj) : error LNK2001: unresolved external symbol _ucnv_toUChars_53
3>sword.lib(utf8nfkd.obj) : error LNK2001: unresolved external symbol _ucnv_toUChars_53
3>sword.lib(stringmgr.obj) : error LNK2019: unresolved external symbol _u_strToUTF8_53 referenced in function "public: virtual char * __thiscall sword::ICUStringMgr::upperUTF8(char *,unsigned int)const " (?upperUTF8 at ***@sword@@UBEPADPADI at Z)
3>sword.lib(stringmgr.obj) : error LNK2019: unresolved external symbol _u_strToUpper_53 referenced in function "public: virtual char * __thiscall sword::ICUStringMgr::upperUTF8(char *,unsigned int)const " (?upperUTF8 at ***@sword@@UBEPADPADI at Z)
3>sword.lib(stringmgr.obj) : error LNK2019: unresolved external symbol _u_strFromUTF8_53 referenced in function "public: virtual char * __thiscall sword::ICUStringMgr::upperUTF8(char *,unsigned int)const " (?upperUTF8 at ***@sword@@UBEPADPADI at Z)
3>sword.lib(curlhttpt.obj) : error LNK2019: unresolved external symbol _curl_easy_init referenced in function "public: __thiscall sword::CURLHTTPTransport::CURLHTTPTransport(char const *,class sword::StatusReporter *)" (??0CURLHTTPTransport at sword@@QAE at ***@1@@Z)
3>sword.lib(curlftpt.obj) : error LNK2001: unresolved external symbol _curl_easy_init
3>sword.lib(curlhttpt.obj) : error LNK2019: unresolved external symbol _curl_easy_cleanup referenced in function "public: virtual __thiscall sword::CURLHTTPTransport::~CURLHTTPTransport(void)" (??1CURLHTTPTransport at sword@@UAE at XZ)
3>sword.lib(curlftpt.obj) : error LNK2001: unresolved external symbol _curl_easy_cleanup
3>sword.lib(curlhttpt.obj) : error LNK2019: unresolved external symbol _curl_easy_perform referenced in function "public: virtual char __thiscall sword::CURLHTTPTransport::getURL(char const *,char const *,class sword::SWBuf *)" (?getURL at ***@sword@@UAEDPBD0PAVSWBuf at 2@@Z)
3>sword.lib(curlftpt.obj) : error LNK2001: unresolved external symbol _curl_easy_perform
3>sword.lib(curlhttpt.obj) : error LNK2019: unresolved external symbol _curl_easy_setopt referenced in function "public: virtual char __thiscall sword::CURLHTTPTransport::getURL(char const *,char const *,class sword::SWBuf *)" (?getURL at ***@sword@@UAEDPBD0PAVSWBuf at 2@@Z)
3>sword.lib(curlftpt.obj) : error LNK2001: unresolved external symbol _curl_easy_setopt
3>sword.lib(scsuutf8.obj) : error LNK2019: unresolved external symbol "__declspec(dllimport) public: virtual __thiscall icu_53::UnicodeString::~UnicodeString(void)" (__imp_??1UnicodeString at icu_53@@UAE at XZ) referenced in function "public: virtual char __thiscall sword::SCSUUTF8::processText(class sword::SWBuf &,class sword::SWKey const *,class sword::SWModule const *)" (?processText at ***@sword@@UAEDAAVSWBuf at ***@PBVSWKey at ***@PBVSWModule at 2@@Z)
3>sword.lib(utf8scsu.obj) : error LNK2001: unresolved external symbol "__declspec(dllimport) public: virtual __thiscall icu_53::UnicodeString::~UnicodeString(void)" (__imp_??1UnicodeString at icu_53@@UAE at XZ)
3>sword.lib(utf8transliterator.obj) : error LNK2001: unresolved external symbol "__declspec(dllimport) public: virtual __thiscall icu_53::UnicodeString::~UnicodeString(void)" (__imp_??1UnicodeString at icu_53@@UAE at XZ)
3>sword.lib(scsuutf8.obj) : error LNK2019: unresolved external symbol "__declspec(dllimport) public: int __thiscall icu_53::UnicodeString::extract(char *,int,struct UConverter *,enum UErrorCode &)const " (__imp_?extract at ***@icu_53@@QBEHPADHPAUUConverter@@AAW4UErrorCode@@@Z) referenced in function "public: virtual char __thiscall sword::SCSUUTF8::processText(class sword::SWBuf &,class sword::SWKey const *,class sword::SWModule const *)" (?processText at ***@sword@@UAEDAAVSWBuf at ***@PBVSWKey at ***@PBVSWModule at 2@@Z)
3>sword.lib(utf8scsu.obj) : error LNK2001: unresolved external symbol "__declspec(dllimport) public: int __thiscall icu_53::UnicodeString::extract(char *,int,struct UConverter *,enum UErrorCode &)const " (__imp_?extract at ***@icu_53@@QBEHPADHPAUUConverter@@AAW4UErrorCode@@@Z)
3>sword.lib(scsuutf8.obj) : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall icu_53::UnicodeString::UnicodeString(char const *,int,struct UConverter *,enum UErrorCode &)" (__imp_??0UnicodeString at icu_53@@QAE at PBDHPAUUConverter@@AAW4UErrorCode@@@Z) referenced in function "public: virtual char __thiscall sword::SCSUUTF8::processText(class sword::SWBuf &,class sword::SWKey const *,class sword::SWModule const *)" (?processText at ***@sword@@UAEDAAVSWBuf at ***@PBVSWKey at ***@PBVSWModule at 2@@Z)
3>sword.lib(utf8scsu.obj) : error LNK2001: unresolved external symbol "__declspec(dllimport) public: __thiscall icu_53::UnicodeString::UnicodeString(char const *,int,struct UConverter *,enum UErrorCode &)" (__imp_??0UnicodeString at icu_53@@QAE at PBDHPAUUConverter@@AAW4UErrorCode@@@Z)
3>sword.lib(bz2comprs.obj) : error LNK2019: unresolved external symbol _BZ2_bzBuffToBuffCompress at 28 referenced in function "public: virtual void __thiscall sword::Bzip2Compress::Encode(void)" (?Encode at ***@sword@@UAEXXZ)
3>sword.lib(bz2comprs.obj) : error LNK2019: unresolved external symbol _BZ2_bzBuffToBuffDecompress at 24 referenced in function "public: virtual void __thiscall sword::Bzip2Compress::Decode(void)" (?Decode at ***@sword@@UAEXXZ)
3>CUSTOMBUILD : error : command 'C:\\Program Files\\Microsoft Visual Studio 10.0\\VC\\BIN\\link.exe' failed with exit status 1120
3>sword.lib(xzcomprs.obj) : error LNK2019: unresolved external symbol _lzma_easy_decoder_memusage referenced in function "public: __thiscall sword::XzCompress::XzCompress(void)" (??0XzCompress at sword@@QAE at XZ)
3>sword.lib(xzcomprs.obj) : error LNK2019: unresolved external symbol _lzma_easy_buffer_encode referenced in function "public: virtual void __thiscall sword::XzCompress::Encode(void)" (?Encode at ***@sword@@UAEXXZ)
3>sword.lib(xzcomprs.obj) : error LNK2019: unresolved external symbol _lzma_stream_buffer_bound referenced in function "public: virtual void __thiscall sword::XzCompress::Encode(void)" (?Encode at ***@sword@@UAEXXZ)
3>sword.lib(xzcomprs.obj) : error LNK2019: unresolved external symbol _lzma_stream_buffer_decode referenced in function "public: virtual void __thiscall sword::XzCompress::Decode(void)" (?Decode at ***@sword@@UAEXXZ)
3>sword.lib(utf8transliterator.obj) : error LNK2019: unresolved external symbol "__declspec(dllimport) public: static class icu_53::Transliterator * __cdecl icu_53::Transliterator::createInstance(class icu_53::UnicodeString const &,enum UTransDirection,enum UErrorCode &)" (__imp_?createInstance at ***@icu_53@@SAPAV12 at ***@2 at W4UTransDirection@@AAW4UErrorCode@@@Z) referenced in function "private: class icu_53::Transliterator * __thiscall sword::UTF8Transliterator::createTrans(class icu_53::UnicodeString const &,enum UTransDirection,enum UErrorCode &)" (?createTrans at ***@sword@@AAEPAVTransliterator at icu_53@@ABVUnicodeString at ***@W4UTransDirection@@AAW4UErrorCode@@@Z)
3>sword.lib(utf8transliterator.obj) : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall icu_53::UnicodeString::UnicodeString(wchar_t const *)" (__imp_??0UnicodeString at icu_53@@QAE at ***@Z) referenced in function "public: virtual char __thiscall sword::UTF8Transliterator::processText(class sword::SWBuf &,class sword::SWKey const *,class sword::SWModule const *)" (?processText at ***@sword@@UAEDAAVSWBuf at ***@PBVSWKey at ***@PBVSWModule at 2@@Z)
3>sword.lib(utf8transliterator.obj) : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall icu_53::UnicodeString::UnicodeString(char const *)" (__imp_??0UnicodeString at icu_53@@QAE at ***@Z) referenced in function "public: virtual char __thiscall sword::UTF8Transliterator::processText(class sword::SWBuf &,class sword::SWKey const *,class sword::SWModule const *)" (?processText at ***@sword@@UAEDAAVSWBuf at ***@PBVSWKey at ***@PBVSWModule at 2@@Z)
3>sword.lib(utf8transliterator.obj) : error LNK2019: unresolved external symbol _ublock_getCode_53 referenced in function "public: virtual char __thiscall sword::UTF8Transliterator::processText(class sword::SWBuf &,class sword::SWKey const *,class sword::SWModule const *)" (?processText at ***@sword@@UAEDAAVSWBuf at ***@PBVSWKey at ***@PBVSWModule at 2@@Z)
3>sword.lib(curlftpt.obj) : error LNK2019: unresolved external symbol _curl_global_init referenced in function "public: __thiscall sword::`anonymous namespace'::CURLFTPTransport_init::CURLFTPTransport_init(void)" (??0CURLFTPTransport_init@?A0x21fc6680 at sword@@QAE at XZ)
3>sword.lib(curlftpt.obj) : error LNK2019: unresolved external symbol _curl_global_cleanup referenced in function "public: __thiscall sword::`anonymous namespace'::CURLFTPTransport_init::~CURLFTPTransport_init(void)" (??1CURLFTPTransport_init@?A0x21fc6680 at sword@@QAE at XZ)
3>sword.lib(utf8nfkd.obj) : error LNK2019: unresolved external symbol _unorm_normalize_53 referenced in function "public: virtual char __thiscall sword::UTF8NFKD::processText(class sword::SWBuf &,class sword::SWKey const *,class sword::SWModule const *)" (?processText at ***@sword@@UAEDAAVSWBuf at ***@PBVSWKey at ***@PBVSWModule at 2@@Z)
3>build\lib.win32-3.4\_Sword.pyd : fatal error LNK1120: 31 unresolved externals
========== Build: 2 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
Nic Carter
2014-09-08 11:56:13 UTC
Permalink
Hi Timothy,

To my very inexperienced (Windows-wise) eyes, it looks like it is struggling to link to ICU? As I have no idea how Visual Studio works, I'm not sure how to direct you to fix the issue, but perhaps look at that?

Perhaps you'd have more success if you tried compiling using cygwin or something like that (if that even exists anymore - I haven't done any development work on a Windows machine for over 10 years!) or, if you have the luxury, a Mac or Linux box? (yes, yes, we have what we have, and there is a huge range of devices being used with SWORD by people on this list, so hopefully someone can help more than I can?)

Thanks, ybic
nic... :)
Post by R Johnson
Hello all,
Today is Labor Day (in the US), and I haven't heard anything about my thread "Building Python binding to Sword on Windows returns exit code 1" since around Memorial Day (May 26) weekend. I'm disappointed by this, because I can't continue working on the Bible software I was attempting to write until I can get the binding built on Windows. I apologize if I offended anyone.
Since I posted my last message, I have upgraded to Sword 1.7.3.dev3138, CMake 3.0.1, and SWIG 3.0.2, which I think fixed one or two of the errors I was getting, but I still am not able to successfully build the Python bindings. I have attached the output logs (abridged) from Visual Studio. The first one is from trying to build the entire libsword solution, and the second one is from trying to rebuild the swordswig subproject (after moving "Sword.lib" from the "Release" subdirectory to the top-level "sword-build" directory).
I'm experienced with Python programming, but know very little C++, so regrettably I'm not able to detect and fix the problems myself. I would really appreciate further help with this. Thank you.
-- Timothy
<Output-20140901.txt><Output-swordswig-20140901.txt>_______________________________________________
sword-devel mailing list: sword-devel at crosswire.org
http://www.crosswire.org/mailman/listinfo/sword-devel
Instructions to unsubscribe/change your settings at above page
Loading...