[liblouis-liblouisxml] Re: LibLouis DLL Compilation Errors

  • From: James Bowden <James.Bowden@xxxxxxxxxxx>
  • To: "liblouis-liblouisxml@xxxxxxxxxxxxx" <liblouis-liblouisxml@xxxxxxxxxxxxx>
  • Date: Fri, 24 Apr 2020 09:32:15 +0000

Hi,

I have never personally compiled Liblouis, but a typical problem if your 
program cannot link is that there is a mismatch in the linker function 
definitions.

One way was to provide a DEF file to the linker.
I don't know if this is the problem here, but it might be.
There was also a keyword something like _dllexport (it is a while since I made 
a DLL using Visual C++).

In your own project, make sure that you have included the liblouis.lib file in 
the link imputs.

Sorry this is vague, but I hope it might give some pointers.

With best regards,

James.






-----Original Message-----
From: liblouis-liblouisxml-bounce@xxxxxxxxxxxxx 
[mailto:liblouis-liblouisxml-bounce@xxxxxxxxxxxxx] On Behalf Of Dang Hoai Phúc
Sent: 23 April 2020 06:23
To: liblouis-liblouisxml@xxxxxxxxxxxxx; Yuemei Sun
Cc: phungtienduong@xxxxxxxxx
Subject: [liblouis-liblouisxml] Re: LibLouis DLL Compilation Errors

Dear Yuemei,

I applied your code and it compiles successfully but it's still with 
error, no functions found from the dll when calling.

Phúc

On 4/23/2020 8:34 AM, Yuemei Sun wrote:

Hi, Phúc

I changed the static declaration of an array to malloc() and free() to 
compile on Windows for liblouis 3.12 using Visutal Studio 2017.

Below is my slight change to the source code:

//=========================10/22/2019====================
//widechar dots[length]; //this causes compiler error on windows
widechar* dots = malloc(length * sizeof(widechar)); //replacng static buffer

if (dots != 0) {//if condition added 10/22/2019
for (unsigned int k = 0; k < length; k += 1) {
widechar c = text[k];
widechar d = _lou_getDotsForChar(c);
if (d == LOU_DOTS) d = _lou_charToFallbackDots(c);
dots[k] = d;
}
}

int iRetUpdatepos = for_updatePositions(dots, 1, length, 0, pos, input, 
output, posMapping,cursorPosition, cursorStatus);

if (dots != 0) //if block added 10/22/2019
free(dots);

return iRetUpdatepos;
//=======================================================

-----Original Message-----
From: liblouis-liblouisxml-bounce@xxxxxxxxxxxxx 
<liblouis-liblouisxml-bounce@xxxxxxxxxxxxx> On Behalf Of Dang Hoai Phúc
Sent: Wednesday, April 22, 2020 6:13 PM
To: Christian Egli <christian.egli@xxxxxx>
Cc: liblouis-liblouisxml@xxxxxxxxxxxxx; phungtienduong@xxxxxxxxx
Subject: [liblouis-liblouisxml] LibLouis DLL Compilation Errors

Dear All,

I have some errors when compiling LibLouis 3.12 and 3.13 into LibLouis.dll 
for windows. I have followed the instruction in source folder to compile with 
Microsoft community 2017. Can you help examine the errors below and advices, 
please?

I have no problem to compile 3.6 version but with 3.12 and 3.13, it has the 
error:

..\liblouis\lou_translateString.c(2254): error C2057: expected constant 
expression
..\liblouis\lou_translateString.c(2254): error C2466: cannot allocate an 
array of constant size 0
..\liblouis\lou_translateString.c(2254): error C2133: 'dots': unknown size 
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual 
Studio\2017\Community\VC\Tools\MSVC\14.16.27023\bin\HostX86\x86\cl.EXE"'
: return
code '0x2'


Then, I checked with the code and see it stucks at the line: widechar 
dots[length];

I changed to: widechar dots[1024];

Now it can compile successfully and got the Liblouis.dll for all 3 versions, 
3.6, 3.12 and 3.13. However, when calling functions like lou_translateString 
and others, it informs cannot find the function.

I have tried to compile with both Microsoft community 2017 and 2019, both 
have the same errors.

Thanks in advance and look forward to your help.

Phúc

For a description of the software, to download it and links to project pages 
go to http://liblouis.org ;<http://liblouis.org
Donate: http://liblouis.org/sponsoring ;<http://liblouis.org/sponsoring
��u��*m���~�^�����޶�h�yhiحjwe�y,��k�7����z�(��m����&�謢��v�zm��剹h�+(�즉좸�g===

-- 
Dang Hoai Phúc/Executive Director
Sao Mai Center for the Blind
Website: https://www.saomaicenter.org ;<https://www.saomaicenter.org

For a description of the software, to download it and links to
project pages go to http://liblouis.org ;<http://liblouis.org
Donate: http://liblouis.org/sponsoring ;<http://liblouis.org/sponsoring


--

During these challenging times, information is vital.  In response, we are 
ramping up our support and services to ensure blind and partially sighted 
people get the help they need.  
We urge anyone in our community who needs us to call our Helpline on 0303 123 
9999 or email helpline@xxxxxxxxxxx.

Help us continue removing barriers that stop people with sight loss from living 
the lives they want to lead - visit https://www.rnib.org.uk to donate today.

--


DISCLAIMER:

NOTICE: The information contained in this email and any attachments is 
confidential and may be privileged.  If you are not the intended recipient you 
should not use, disclose, distribute or copy any of the content of it or of any 
attachment; you are requested to notify the sender immediately of your receipt 
of the email and then to delete it and any attachments from your system.

RNIB endeavours to ensure that emails and any attachments generated by its 
staff are free from viruses or other contaminants.  However, it cannot accept 
any responsibility for any  such which are transmitted.

We therefore recommend you scan all attachments.

Please note that the statements and views expressed in this email and any 
attachments are those of the author and do not necessarily represent those of 
RNIB.

RNIB Registered Charity Number: 226227

Website: https://www.rnib.org.uk
��u��*m���~�^�����޶�h�yhiحjwe�y,��k�7����z�(��m����&��謢��v�zm��剹h�+(�즉좸�

Other related posts: