[liblouis-liblouisxml] Re: Cross compiling liblouisutdml with Java bindings

  • From: Keith Creasy <kcreasy@xxxxxxx>
  • To: "liblouis-liblouisxml@xxxxxxxxxxxxx" <liblouis-liblouisxml@xxxxxxxxxxxxx>
  • Date: Fri, 19 Sep 2014 12:15:04 +0000

Sounds like good news Michael. Thanks.

Keith


-----Original Message-----
From: liblouis-liblouisxml-bounce@xxxxxxxxxxxxx 
[mailto:liblouis-liblouisxml-bounce@xxxxxxxxxxxxx] On Behalf Of Bert Frees
Sent: Friday, September 19, 2014 8:12 AM
To: liblouis-liblouisxml@xxxxxxxxxxxxx
Subject: [liblouis-liblouisxml] Re: Cross compiling liblouisutdml with Java 
bindings

OK, just to be clear: I've never actually tried the Java bindings with a 
cross-compiled liblouisutdml.dll, all I know is that I managed to compile 
without getting errors.

If this code change solves your problem and it doesn't affect the linux build I 
don't have any objection. What is the difference with __stdcall which is used 
in liblouis?


Thanks,
Bert


Michael Whapples writes:

> Hello,
> I am not sure whether mingw32 works differently to mingw-w64.
>
> I think I have found a solution although it has required doing source 
> code modification. I am about to commit my changes.
>
> The short description of what the problem is: It appeared that when 
> building the Java bindings liblouisutdml's C API functions were not 
> being exported in liblouisutdml.dll.a. It seems like I need to prefix 
> the API functions with __declspec(dllexport). I have made the changes 
> in such a way that it is not added to non-windows builds and when 
> compiling against liblouisutdml it will be __declspec(dllimport).
>
> Michael Whapples
> On 19/09/2014 12:18, Bert Frees wrote:
>> Hi Michael,
>>
>> I don't think I have to do anything special for it to work. I'm using 
>> --host i586-mingw32msvc.
>>
>>
>> Michael Whapples writes:
>>
>>> Hello,
>>> I am having trouble cross compiling liblouisutdml with its Java 
>>> bindings on linux and mingw-w64.
>>>
>>> Having done some reading it appears that JNI requires a particular 
>>> set of link options and calling conventions. I found a document 
>>> online discussing compiling JNI libraries with mingw.
>>>
>>> http://www.transmissionzero.co.uk/computing/advanced-mingw-dll-topic
>>> s/
>>>
>>> According to that I need to pass --kill-at to the linker, so I added 
>>> -Wl,--kill-at to the LDFALAGS.
>>>
>>> However now compilation is failing with link errors like:
>>> /home/mwhapples/liblouisutdml/tools/file2brl.c:311: undefined 
>>> reference to `_lbu_backTranslateFile@24'
>>>
>>> I take it that this is related to Java's linkage requirements as 
>>> when I compile without java bindings (and thus without the options 
>>> for JNI) liblouisutdml compiles fine without issue.
>>>
>>> What do I need to do to get the Java bindings to compile with mingw?
For a description of the software, to download it and links to project pages go 
to http://www.abilitiessoft.com
For a description of the software, to download it and links to
project pages go to http://www.abilitiessoft.com

Other related posts: