[liblouis-liblouisxml] Re: Compilation problem with new findTable.c in Windows (MS Visual Studio)

  • From: "Arend Arends" <arendarends@xxxxxxxx>
  • To: <liblouis-liblouisxml@xxxxxxxxxxxxx>
  • Date: Fri, 4 Nov 2016 16:50:02 +0100

Paulw.torchtrust signaturePaul and I had a private conversation to track down 
the problem with the compilation of liblouis.dll release version 3.0.0 for 
Windows. 
The result was that the release version compiles correctly with MS Visual 
Studio 2015 (older compiler versions may have problems), provided that the file 
windows/liblouis.def is changed: 
The last two lines with the names lou_findTable and lou_indexTables should be 
removed. 
This has already been done in the github master and will be corrected in the 
next release.

These function names belonged to findTable.c and were the cause of an error in 
the compilation. To solve this I added the name of the existing file  
findTable.c to makefile.nmake which caused more errors. This file is not 
necessary for a normal use of liblouis.dll.

In addition: In the meantime I tested liblouis.dll version 3.0.0 and an older 
version of liblouisutdml.dll with our program TactileView. This seems to work 
alright.

Arend Arends

From: Paul Wood (Torch) 
Sent: Thursday, November 3, 2016 10:41 PM
To: liblouis-liblouisxml@xxxxxxxxxxxxx 
Subject: [liblouis-liblouisxml] Re: Compilation problem with new findTable.c in 
Windows (MS Visual Studio)

In reply to your previous email, I have got liblouis 3.0.0 working with 
liblouisutdml, well I did before my latest updates to that pull request, but I 
don't see why there should be a problem with the changes I made. If you want my 
project files, I'm happy to let you have them. I had to build various 
dependancies, If I remember right, so never got the 64-bit version working of 
liblouisutdml.

HTH
Paul




On 03/11/2016 20:02, Arend Arends wrote:

  Since the compiler that I used was a rather old one, I installed Visual 
Studio Community 2015 and some of the peculiarities seem to have gone (unless I 
already solved them).
  For strndup, which is not supported by this and other MS compilers (only 
strdup is supported), I added a replacement from 
http://opensource.apple.com//source/gcc/gcc-5666.3/libiberty/strndup.c.
  It now compiles to liblouis.dll.
  I will further test tomorrow.

  In conclusion the files in de Windows section still need some improvement.

  Arend Arends

  From: Arend Arends 
  Sent: Thursday, November 3, 2016 2:34 PM
  To: liblouis-liblouisxml@xxxxxxxxxxxxx 
  Subject: [liblouis-liblouisxml] Compilation problem with new findTable.c in 
Windows (MS Visual Studio)

  I am trying to compile LibLouis 3.0.0 in Windows with MS Visual Studio.

  Initially I solved a few minor problems.
  Then I found that the new component findTable.c (added by Bert Frees 2015?) 
was not added to windows\makefile.nmake.

  After I changed makefile.nmake, the compiler could not find dirent.h.
  It seems dirent.h is not supported normally by Visual Studio, but is included 
in the MinGW compiler. There is a version of dirent.h available via 
http://softagalleria.net/dirent.php that can be used with Visual Studio.
  After I copied it, I tried to compile again, but this time the compilation of 
findTable.c gave several problems, that I list at the end of this message.

  At the moment I cannot solve these compilation problems easily.
  For reference, the first error appears in line 98 with the contents:
        List * l3 = malloc(sizeof(List));

  Before I dive into these problems further:

  Is findTable.c a necessary part of LibLouis.dll?
  If not, is there an easy way to remove this part or replace it by a stub?
  Has anyone tried to combine LibLouisutdml yet with version 3.0.0?
  If I cannot solve these problems shortly I will have to stick with version 
2.6.5 (actually I am still using 2.6.4) for our next release of TactileView.

  Best regards,

  Arend Arends

  Contents of Command Prompt:

  C:\Users\Arend\Documents\TactileView\LibLouis\liblouis-3.0.0\windows>nmake /f 
makefile.nmake

  Microsoft (R) Program Maintenance Utility Version 7.10.3077
  Copyright (C) Microsoft Corporation.  All rights reserved.

          cl.exe /nologo /O2 /W3 /c /MD /D_CRT_SECURE_NO_WARNINGS 
/D_CRT_NONSTDC_NO_DEPRECATE /Iinclude /DWIDECHAR_TYPE="unsigned short int" 
/DUNICODEBITS=16 ..\liblouis\findTable.c
  findTable.c
  ..\liblouis\findTable.c(98) : error C2275: 'List' : illegal use of this type 
as an expression
          ..\liblouis\findTable.c(43) : see declaration of 'List'
  ..\liblouis\findTable.c(98) : error C2065: 'l3' : undeclared identifier
  ..\liblouis\findTable.c(99) : error C2223: left of '->head' must point to 
struct/union
  ..\liblouis\findTable.c(100) : error C2223: left of '->free' must point to 
struct/union
  ..\liblouis\findTable.c(101) : error C2223: left of '->tail' must point to 
struct/union
  ..\liblouis\findTable.c(103) : warning C4047: '=' : 'List *' differs in 
levels of indirection from 'int'
  ..\liblouis\findTable.c(105) : warning C4047: '=' : 'List *' differs in 
levels of indirection from 'int'
  ..\liblouis\findTable.c(270) : error C2143: syntax error : missing ';' before 
'type'
  ..\liblouis\findTable.c(271) : error C2143: syntax error : missing ';' before 
'const'
  ..\liblouis\findTable.c(272) : error C2143: syntax error : missing ';' before 
'const'
  ..\liblouis\findTable.c(275) : error C2065: 'l1' : undeclared identifier
  ..\liblouis\findTable.c(277) : error C2065: 'l2' : undeclared identifier
  ..\liblouis\findTable.c(279) : error C2065: 'quotient' : undeclared identifier
  ..\liblouis\findTable.c(280) : error C2223: left of '->tail' must point to 
struct/union
  ..\liblouis\findTable.c(285) : error C2223: left of '->tail' must point to 
struct/union
  ..\liblouis\findTable.c(289) : error C2223: left of '->head' must point to 
struct/union
  ..\liblouis\findTable.c(289) : error C2223: left of '->head' must point to 
struct/union
  ..\liblouis\findTable.c(289) : error C2198: 'cmpKeys' : too few arguments for 
call through pointer-to-function
  ..\liblouis\findTable.c(293) : error C2223: left of '->tail' must point to 
struct/union
  ..\liblouis\findTable.c(298) : error C2223: left of '->tail' must point to 
struct/union
  ..\liblouis\findTable.c(302) : error C2223: left of '->head' must point to 
struct/union
  ..\liblouis\findTable.c(302) : error C2223: left of '->head' must point to 
struct/union
  ..\liblouis\findTable.c(302) : error C2168: 'strcmp' : too few actual 
parameters for intrinsic function
  ..\liblouis\findTable.c(306) : error C2223: left of '->tail' must point to 
struct/union
  ..\liblouis\findTable.c(307) : error C2223: left of '->tail' must point to 
struct/union
  ..\liblouis\findTable.c(344) : warning C4554: '|' : check operator precedence 
for possible error; use parentheses to clarify precedence
  ..\liblouis\findTable.c(348) : warning C4013: 'strndup' undefined; assuming 
extern returning int
  ..\liblouis\findTable.c(348) : warning C4047: 'initializing' : 'char *' 
differs in levels of indirection from 'int'
  ..\liblouis\findTable.c(349) : warning C4047: ':' : 'int' differs in levels 
of indirection from 'void *'
  ..\liblouis\findTable.c(349) : warning C4047: 'initializing' : 'char *' 
differs in levels of indirection from 'int'
  ..\liblouis\findTable.c(350) : error C2440: 'initializing' : cannot convert 
from 'Feature' to 'char *'
  ..\liblouis\findTable.c(393) : error C2143: syntax error : missing ';' before 
'type'
  ..\liblouis\findTable.c(394) : error C2275: 'List' : illegal use of this type 
as an expression
          ..\liblouis\findTable.c(43) : see declaration of 'List'
  ..\liblouis\findTable.c(394) : error C2065: 'l' : undeclared identifier
  ..\liblouis\findTable.c(395) : warning C4047: '=' : 'int' differs in levels 
of indirection from 'List *'
  ..\liblouis\findTable.c(395) : error C2223: left of '->tail' must point to 
struct/union
  ..\liblouis\findTable.c(397) : error C2223: left of '->head' must point to 
struct/union
  ..\liblouis\findTable.c(398) : error C2065: 'k' : undeclared identifier
  ..\liblouis\findTable.c(415) : warning C4018: '<' : signed/unsigned mismatch
  ..\liblouis\findTable.c(416) : warning C4244: '=' : conversion from 'const 
widechar' to 'char', possible loss of data
  ..\liblouis\findTable.c(466) : warning C4244: 'function' : conversion from 
'widechar' to 'char', possible loss of data
  ..\liblouis\findTable.c(471) : warning C4244: 'function' : conversion from 
'widechar' to 'char', possible loss of data
  ..\liblouis\findTable.c(482) : warning C4244: 'function' : conversion from 
'widechar' to 'char', possible loss of data
  ..\liblouis\findTable.c(487) : warning C4244: 'function' : conversion from 
'widechar' to 'char', possible loss of data
  ..\liblouis\findTable.c(545) : error C2275: 'List' : illegal use of this type 
as an expression
          ..\liblouis\findTable.c(43) : see declaration of 'List'
  ..\liblouis\findTable.c(545) : error C2065: 'features' : undeclared identifier
  ..\liblouis\findTable.c(548) : warning C4047: 'initializing' : 'List *' 
differs in levels of indirection from 'int'
  ..\liblouis\findTable.c(580) : warning C4047: '=' : 'char *' differs in 
levels of indirection from 'int'
  ..\liblouis\findTable.c(622) : warning C4090: 'function' : different 'const' 
qualifiers
  ..\liblouis\findTable.c(624) : error C2275: 'List' : illegal use of this type 
as an expression
          ..\liblouis\findTable.c(43) : see declaration of 'List'
  ..\liblouis\findTable.c(624) : error C2065: 'queryFeatures' : undeclared 
identifier
  ..\liblouis\findTable.c(625) : error C2143: syntax error : missing ';' before 
'type'
  ..\liblouis\findTable.c(626) : error C2143: syntax error : missing ';' before 
'type'
  ..\liblouis\findTable.c(627) : error C2275: 'List' : illegal use of this type 
as an expression
          ..\liblouis\findTable.c(43) : see declaration of 'List'
  ..\liblouis\findTable.c(628) : warning C4047: '=' : 'int' differs in levels 
of indirection from 'List *'
  ..\liblouis\findTable.c(628) : error C2223: left of '->tail' must point to 
struct/union
  ..\liblouis\findTable.c(630) : error C2223: left of '->head' must point to 
struct/union
  ..\liblouis\findTable.c(631) : warning C4047: 'function' : 'const List *' 
differs in levels of indirection from 'int'
  ..\liblouis\findTable.c(632) : error C2065: 'bestQuotient' : undeclared 
identifier
  ..\liblouis\findTable.c(635) : error C2065: 'bestMatch' : undeclared 
identifier
  ..\liblouis\findTable.c(635) : warning C4047: '=' : 'int' differs in levels 
of indirection from 'char *'
  ..\liblouis\findTable.c(641) : warning C4047: 'return' : 'char *' differs in 
levels of indirection from 'int'
  NMAKE : fatal error U1077: 'cl.exe' : return code '0x2'
  Stop.


-- 

Paul Wood, Chief Technical Officer
Torch Trust
Torch House, Torch Way,
Market Harborough, Leics. LE16 9HL, UK
Direct Line: +44(0)1858 438269
Tel: +44(0)1858 438260, Fax: +44(0)1858 438275
Email: paulw@xxxxxxxxxxxxxx
Website: www.torchtrust.org

____________________________________________________

Chief Executive: Dr Gordon Temple
Charity No. 1095904

Privileged/Confidential Information may be contained in this message. 
If you are not the intended recipient please destroy this message 
and kindly notify the sender by reply email. The computer from which 
this mail originates is equipped with virus screening software. 
However Torch Trust cannot guarantee that the mail and its attachments 
are free from virus infection.

Other related posts: