[sword-devel] Building libsword on windows

Greg Hellings greg.hellings at gmail.com
Wed Dec 31 19:14:00 MST 2014


When you are trying to compile with mingw, what is your host environment?
Karl Kleinpaste and I build for Windows with the mingw toolchain from Linux
on a regular basis.

If you are building the latest release of sword (1.7.4) with cmake+mingw
you will likely find that the .dll is stored in the bin/ folder and not in
the lib/ folder. This is because Windows needs the dll to be accessible on
the same path as the executable (that's probably why you had run time
problems linking against the version from Xiphos).

--Greg
On Dec 31, 2014 9:03 PM, "Daniel Sheffield" <d.j.yotta at gmail.com> wrote:

> Hi Jon,
>
> Yeah, I hadn't done all the steps correctly - nevertheless MSVS was still
> generating the dll.
> It appears it's a mingw/msvc interoperability issue because the dll is
> generated but I can't link against it.
>
> I can't seem to build it with cmake either. I get as far as the libsword.a
> and libsword.dll.a but no libsword.dll. When I put those in my build dir
> and link: -llibsword
> compiles fine but then I get run-time error libsword.dll missing.
>
> :(
>
> --
> In the beginning Kibo created the Internet. Now the Internet was formless,
> and empty. Randomness was upon the face of computing, and the Spirit of
> ARPA moved upon the face of the computers. Then Kibo said, "Let there be
> data": and there was data. Kibo saw the data, and it was good, so Kibo
> divided the data from the randomness, and Kibo named the data Information,
> and the randomness Clueless. And the Information and the Clueless were the
> first Network.
>
> On Thu, Jan 1, 2015 at 1:45 PM, Jon Behrens <biz at crimsonthread.com> wrote:
>
>>  Hi Daniel
>> Since your problem is in the flatapi, continue in the instructions for
>> the c# bindings.
>> There are some changes that need to be made in the dll export declaration
>> to get
>> it to work with Windows. Those are steps 5 and 6 of the tutorial. Also,
>> in step 9, you
>> need to make sure that the dlls listed are in the same directory as your
>> project output
>> (or in a lib path)
>> Jon
>>
>> On 12/31/2014 4:04 PM, Daniel Sheffield wrote:
>>
>>    Hi Jon,
>>
>>  Thanks for that help, I changed icu-sword dir back to icu (it really is
>> the latest icu - not icu-sword!), and rebuilt the dll.
>>  Still can't link to it: -lsword -licuuc54 -licuin54 -licudt54
>>  Linker doesn't complain can't find lib or anything, but still outputs
>> the errors in my prior message.
>>  undefined reference to 'sword:SWModule\SWMgr\SWkey\SWBuf\MarkupFilterMgr'
>> - which appear to all be in flatapi.h so I really don't know why they
>> aren't their after following the directions here:
>> http://www.crosswire.org/wiki/CSharp_Bindings_on_Windows
>>
>>  Cheers for your help,
>> Daniel
>>
>>  --
>> In the beginning Kibo created the Internet. Now the Internet was
>> formless, and empty. Randomness was upon the face of computing, and the
>> Spirit of ARPA moved upon the face of the computers. Then Kibo said, "Let
>> there be data": and there was data. Kibo saw the data, and it was good, so
>> Kibo divided the data from the randomness, and Kibo named the data
>> Information, and the randomness Clueless. And the Information and the
>> Clueless were the first Network.
>>
>> On Thu, Jan 1, 2015 at 8:03 AM, Jon Behrens <jbb at crimsonthread.com>
>> wrote:
>>
>>> Hello Daniel
>>> Look here http://www.crosswire.org/wiki/CSharp_Bindings_on_Windows
>>> The first section of this tutorial deals with changes needed to get
>>> Sword 1.7.3 to build
>>> with VS2013. You can ignore the remainder.
>>> Be blessed,
>>> Jon
>>>
>>> On 12/30/2014 8:29 PM, Daniel Sheffield wrote:
>>>
>>>>  Hi all,
>>>>
>>>> I've been having trouble building libsword.dll for windows.
>>>> I've followed the information here:
>>>> http://www.crosswire.org/wiki/Tutorial:Compiling_%26_Installing_SWORD_on_Windows
>>>>
>>>> Finally figured out (searching the sword-devel archives) that all I
>>>> needed to do was rename icu to icu-sword and similarly rename the curl
>>>> output dir to what MSVS was expecting and I was able to build the solution.
>>>>
>>>> However: I can't seem to link against the libsword.dll/libsword.lib.
>>>> The only way I have been able to successfully build my project with
>>>> libsword is by adding objects.a (generated by cross-compiling libsword on
>>>> linux using mxe) to the list of sources which effectively copies all the
>>>> objects in.
>>>>
>>>> This is what I get at compile time when I link against libsword.dll
>>>> agents\sword\sword.o:sword.cpp:(.text+0x41): undefined reference to `
>>>> sword::MarkupFilterMgr::MarkupFilterMgr(char, char)'
>>>> agents\sword\sword.o:sword.cpp:(.text+0x5c): undefined reference to `
>>>> sword::SWMgr::SWMgr(sword::SWFilterMgr*, bool)'
>>>> agents\sword\sword.o:sword.cpp:(.text+0x95): undefined reference to `
>>>> sword::SWKey::SWKey(char const*)'
>>>> agents\sword\sword.o:sword.cpp:(.text+0xb5): undefined reference to `
>>>> sword::SWKey::~SWKey()'
>>>> agents\sword\sword.o:sword.cpp:(.text+0xdd): undefined reference to `
>>>> sword::SWModule::renderText(char const*, int, bool)'
>>>> agents\sword\sword.o:sword.cpp:(.text+0x10b): undefined reference to `
>>>> sword::SWMgr::~SWMgr()'
>>>> agents\sword\sword.o:sword.cpp:(.text+0x129): undefined reference to `
>>>> sword::SWKey::~SWKey()'
>>>> agents\sword\sword.o:sword.cpp:(.text+0x13a): undefined reference to `
>>>> sword::SWMgr::~SWMgr()'
>>>> agents\sword\sword.o:sword.cpp:(.text$_ZN5sword5SWBufD1Ev[__ZN5sword5SWBufD1Ev]+0xfffffe6c):
>>>> undefined reference to `sword::SWBuf::nullStr'
>>>>
>>>> These compile time errors disappear when I add objects.a to the list of
>>>> sources AND there are no run-time errors either (despite neither linking
>>>> against icu).
>>>>
>>>> I have no idea whats going on. Perhaps it's because I build
>>>> libsword.dll with MS Visual Studio and am trying to link it with MinGW's
>>>> g++...
>>>>
>>>> If anyone can help I'd appreciate it!
>>>>
>>>> Daniel Sheffield
>>>>
>>>> Associate Engineer - Software
>>>> Level 2, Building A, The Millennium Building Phase 2, 600 Great South
>>>> Road
>>>> Ellerslie,
>>>> Auckland,
>>>> 1051
>>>>
>>>> +64 9 926 2895 Office
>>>> +64 21 1408 708 Mobile
>>>> http://www.emulex.com
>>>>
>>>> On Tue, 30 Dec 2014, Troy A. Griffitts wrote:
>>>>
>>>>  Done.  Thanks for subscribing!
>>>>>
>>>>>
>>>>> On 12/30/2014 03:21 PM, Daniel Sheffield wrote:
>>>>>
>>>>>> Sorry to bother you yet again...
>>>>>> I filled out some form
>>>>>> http://www.crosswire.org/mailman/listinfo/sword-devel and was
>>>>>> directed to send an e-mail to sword-support to verify I am not a robot.
>>>>>> My question is when my e-mail and password will be active on
>>>>>> sword-devel. I just tried it now and was rejected.
>>>>>>
>>>>>> I'm aware this all takes time - I'm not in a rush - just checking
>>>>>> that I've actually completed all the steps to subscribe.
>>>>>>
>>>>>> Cheers,
>>>>>>
>>>>>> Daniel Sheffield
>>>>>>
>>>>>> Associate Engineer - Software
>>>>>> Level 2, Building A, The Millennium Building Phase 2, 600 Great South
>>>>>> Road
>>>>>> Ellerslie,
>>>>>> Auckland,
>>>>>> 1051
>>>>>>
>>>>>> +64 9 926 2895 <%2B64%209%20926%202895> Office
>>>>>> +64 21 1408 708 <%2B64%2021%201408%20708> Mobile
>>>>>> http://www.emulex.com
>>>>>>
>>>>>> On Tue, 30 Dec 2014, Peter von Kaehne wrote:
>>>>>>
>>>>>>
>>>>>>> Daniel, i think you should subscribe to sword-devel. Sword support
>>>>>>> is more about people not being
>>>>>>> able to understand the programms they downloaded etc. I am sure your
>>>>>>> problem has been discussed
>>>>>>> several times on that list.
>>>>>>>
>>>>>>> Biblecs might be a VS programme, but most others use msys which is a
>>>>>>> pared down unixy
>>>>>>> buildenvironment
>>>>>>>
>>>>>>> On 30 Dec 2014 20:49, Daniel Sheffield <d.j.yotta at gmail.com> wrote:
>>>>>>>       Yeah, I've stumbled accross MSYS which appears to a particular
>>>>>>> build environment on
>>>>>>>       windows?
>>>>>>>
>>>>>>> In regards to my linking issuse, the latest news is that I have
>>>>>>> managed to link against the
>>>>>>> libsword.dll.a and, because of the run time errors, tracked the
>>>>>>> undefined references down to
>>>>>>> the icu*54.dlls. I'll try recompiling them (I also downloaded
>>>>>>> pre-compiled ones for icu too -
>>>>>>> dunno if I've tried those).
>>>>>>>
>>>>>>> I don't know why, but when I use libsword.a instead of
>>>>>>> libsword.dll.a, I get neither compile
>>>>>>> time nor run time errors. Then again, I haven't tried actually
>>>>>>> calling the sword functions yet
>>>>>>> in my windows port - just wanted it to compile first!
>>>>>>>
>>>>>>> Atm, I'm reading up about all these forms of library files. I think
>>>>>>> that will help me figure
>>>>>>> out what is going on.
>>>>>>>
>>>>>>> Cheers,
>>>>>>> Daniel
>>>>>>>
>>>>>>> --
>>>>>>> In the beginning Kibo created the Internet. Now the Internet was
>>>>>>> formless, and empty.
>>>>>>> Randomness was upon the face of computing, and the Spirit of ARPA
>>>>>>> moved upon the face of the
>>>>>>> computers. Then Kibo said, "Let there be data": and there was data.
>>>>>>> Kibo saw the data, and it
>>>>>>> was good, so Kibo divided the data from the randomness, and Kibo
>>>>>>> named the data Information,
>>>>>>> and the randomness Clueless. And the Information and the Clueless
>>>>>>> were the first Network.
>>>>>>>
>>>>>>> On Wed, Dec 31, 2014 at 12:37 AM, Peter von Kaehne <
>>>>>>> refdoc at crosswire.org> wrote:
>>>>>>>       Not a programmer, but i am thinking , most things are done
>>>>>>> successfully via msys
>>>>>>>       rather than via MS stuff.
>>>>>>>
>>>>>>>       On 30 Dec 2014 05:34, Daniel Sheffield <d.j.yotta at gmail.com>
>>>>>>> wrote:
>>>>>>>       >
>>>>>>>       > Hi,
>>>>>>>       >
>>>>>>>       > I develop mainly on linux and have been linking to the sword
>>>>>>> library for a
>>>>>>>       project I'm working on (bibq hosted on sourceforge).
>>>>>>>       >
>>>>>>>       > I have ported my project also to windows, but have been
>>>>>>> having difficulty
>>>>>>>       compiling libsword.dll.
>>>>>>>       > Xiphos was the only package I could find that had this dill
>>>>>>> precompiled and I
>>>>>>>       tried using that.
>>>>>>>       > After suffering dll hell, I finally managed to find all the
>>>>>>> dlls the xiphos
>>>>>>>       libsword.dll depended on only to have missing functions at
>>>>>>> runtime.
>>>>>>>       >
>>>>>>>       > Idealy, I want to compile libsword.dll from scratch but I
>>>>>>> have tried every which
>>>>>>>       way to do this.
>>>>>>>       >
>>>>>>>       > . I followed the instructions here:
>>>>>>>
>>>>>>> http://crosswire.org/wiki/Tutorial:Compiling_%26_Installing_SWORD_on_Windows
>>>>>>>       eventually building all the dependancies except clucene which
>>>>>>> eludes all attempts
>>>>>>>       at building on windows. I attempted compiling without clucene
>>>>>>> and appeared to get
>>>>>>>       errors that didn't relate to clucene anyhow and couldn't
>>>>>>> progress any further.
>>>>>>>       > . I then tried cross-compiling on linux targeted at windows.
>>>>>>> I used mxe and
>>>>>>>       things went pretty smoothly but I get link errors at the final
>>>>>>> step of linking
>>>>>>>       libsword.dll (to do with icu).
>>>>>>>       >
>>>>>>>       > I'm about ready to give up and use jsword - but that feels
>>>>>>> so wrong!
>>>>>>>       >
>>>>>>>       > I guess I'm not really expecting to be hand-held through the
>>>>>>> build process, but
>>>>>>>       my main question is why I can't simply build using MS Visual
>>>>>>> Studio? There seems
>>>>>>>       to be a problem with MS Visual Studio 2013 as I've encountered
>>>>>>> even errors such as
>>>>>>>       "can not find stdio.h/stdlib.h" when generating the clucene
>>>>>>> solution with cmake.
>>>>>>>       The solution file for SWORD also doesn't build. I'm most
>>>>>>> likely noobing something
>>>>>>>       here though because I never develop on windows before - other
>>>>>>> than "hello world"
>>>>>>>       type stuff. And now I know why!
>>>>>>>       >
>>>>>>>       > Cheers if you can help.
>>>>>>>       > Daniel
>>>>>>>       > --
>>>>>>>       > In the beginning Kibo created the Internet. Now the Internet
>>>>>>> was formless, and
>>>>>>>       empty. Randomness was upon the face of computing, and the
>>>>>>> Spirit of ARPA moved
>>>>>>>       upon the face of the computers. Then Kibo said, "Let there be
>>>>>>> data": and there was
>>>>>>>       data. Kibo saw the data, and it was good, so Kibo divided the
>>>>>>> data from the
>>>>>>>       randomness, and Kibo named the data Information, and the
>>>>>>> randomness Clueless. And
>>>>>>>       the Information and the Clueless were the first Network.
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>> _______________________________________________
>>>>>> sword-support mailing list
>>>>>> sword-support at crosswire.org
>>>>>>
>>>>>
>>>>>
>>>>>
>>>>  _______________________________________________
>>>> 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
>>>>
>>>
>>>
>>>
>>> _______________________________________________
>>> 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
>>>
>>
>>
>>
>> This body part will be downloaded on demand.
>>
>>
>>
>> _______________________________________________
>> 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
>>
>
>
> _______________________________________________
> 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
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.crosswire.org/pipermail/sword-devel/attachments/20141231/b8804a31/attachment-0001.html>


More information about the sword-devel mailing list