Hi Christian, Sorry, I should have been more clear on that. The file liblouis.h is the include file from v2.6.1, located in windows\include. There probably wouldn't be any difference between 2.6.1 and 2.6.2, since these files apparently haven't been touched since 2.5.2. I have attached the file for convenience. The file does look somewhat different from liblouis.h.in in the liblouis directory, which BTW won't compile on Windows either. I suppose it is using some syntax special to GNU. The compilation of liblouis itself goes smoothly using vs2008 and the file makefile.nmake. But then, it looks to me like Windows\include\liblouis.h is not really being used in that process. Any good ideas? Bue -----Oprindelig meddelelse----- Fra: liblouis-liblouisxml-bounce@xxxxxxxxxxxxx [mailto:liblouis-liblouisxml-bounce@xxxxxxxxxxxxx] På vegne af Christian Egli Sendt: 9. marts 2015 10:49 Til: liblouis-liblouisxml@xxxxxxxxxxxxx Emne: [liblouis-liblouisxml] Re: Errors in liblouis.h when compiling small test program under Windows Hi Bue On 03/08/2015 09:25 PM, Bue Vester-Andersen wrote: > I have made the smallest possible test program in C to be compiled with > VS2008 on Windows. The program looks as follows: > > #include <stdio.h> > #include <stdlib.h> > #include "liblouis.h" > > int main() { > printf ("%s\n", lou_version()); > return 0; > } > > Before i go bug hunting in windows\include\liblouis.h, have I overlooked > something completely basic? Well your test program looks ok afaik. > Except, of course, for the fact that I should be > running a real compiler on a real operating system ETC. ETC. Let's not get too carried away. It's not that I discourage the use of other compilers, it's just that I have no experience with them and I have my reservations about how the files in the windows\include are created/kept up-to-date. > BTW., the config.h in the same folder still states that the version is > 2.5.2. I know. This is a problem of how the files in windows\include are updated. > When I compile the program with the default options, I get the following > errors: > > test_liblouis.c > d:\programmering\arcobraille\liblouis.h(76) : error C2143: syntax error : > missing ')' before '*' > d:\programmering\arcobraille\liblouis.h(76) : error C2143: syntax error : > missing '{' before '*' > d:\programmering\arcobraille\liblouis.h(77) : error C2059: syntax error : > 'type' > ... ETC ETC Can you post the file programmering\arcobraille\liblouis.h? HTH Christian -- Christian Egli Swiss Library for the Blind, Visually Impaired and Print Disabled Grubenstrasse 12, CH-8045 Zürich, Switzerland ----- Neue Version SBS-Online-Bibliothek: Mit wenigen Klicks zum Buch unter http://online.sbs.ch For a description of the software, to download it and links to project pages go to http://liblouis.org
/* liblouis Braille Translation and Back-Translation Library Based on the Linux screenreader BRLTTY, copyright (C) 1999-2006 by The BRLTTY Team Copyright (C) 2004, 2005, 2006, 2009 ViewPlus Technologies, Inc. www.viewplus.com and JJB Software, Inc. www.jjb-software.com liblouis is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. liblouis is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. Maintained by John J. Boyer john.boyer@xxxxxxxxxxxxxxxxx */ #ifndef __LIBLOUIS_H_ #define __LIBLOUIS_H_ #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ #define widechar WIDECHAR_TYPE #define formtype unsigned char #ifdef _WIN32 #define EXPORT_CALL __stdcall char * EXPORT_CALL lou_getProgramPath (void); #else #define EXPORT_CALL #endif typedef enum { plain_text = 0, italic = 1, underline = 2, bold = 4, computer_braille = 8 } typeforms; #define comp_emph_1 italic #define comp_emph_2 underline #define comp_emph_3 bold typedef enum { noContractions = 1, compbrlAtCursor = 2, dotsIO = 4, comp8Dots = 8, pass1Only = 16, compbrlLeftCursor = 32, otherTrans = 64, ucBrl = 128 } translationModes; char * EXPORT_CALL lou_version (void); int EXPORT_CALL lou_charSize (void); /* Return the size of widechar */ int EXPORT_CALL lou_translateString (const char *tableList, const widechar *inbuf, int *inlen, widechar * outbuf, int *outlen, formtype *typeform, char *spacing, int mode); int EXPORT_CALL lou_translate (const char *tableList, const widechar *inbuf, int *inlen, widechar * outbuf, int *outlen, formtype *typeform, char *spacing, int *outputPos, int *inputPos, int *cursorPos, int mode); int EXPORT_CALL lou_hyphenate (const char *tableList, const widechar *inbuf, int inlen, char *hyphens, int mode); int EXPORT_CALL lou_dotsToChar (const char *tableList, widechar *inbuf, widechar *outbuf, int length, int mode); int EXPORT_CALL lou_charToDots (const char *tableList, const widechar *inbuf, widechar *outbuf, int length, int mode); int EXPORT_CALL lou_backTranslateString (const char *tableList, const widechar *inbuf, int *inlen, widechar * outbuf, int *outlen, formtype *typeform, char *spacing, int mode); int EXPORT_CALL lou_backTranslate (const char *tableList, const widechar *inbuf, int *inlen, widechar * outbuf, int *outlen, formtype *typeform, char *spacing, int *outputPos, int *inputPos, int *cursorPos, int mode); void EXPORT_CALL lou_logPrint (const char *format, ...); /* prints error messages to a file */ void EXPORT_CALL lou_logFile (const char *filename); /* Specifies the name of the file to be used by lou_logPrint. If it is * not used, this file is stderr*/ int EXPORT_CALL lou_readCharFromFile (const char *fileName, int *mode); /*Read a character from a file, whether big-encian, little-endian or * ASCII8, and return it as an integer. EOF at end of file. Mode = 1 on * first call, any other value thereafter*/ void EXPORT_CALL lou_logEnd (void); /* Closes the log file so it can be read by other functions. */ void * EXPORT_CALL lou_getTable (const char *tableList); /* This function checks a table for errors. If none are found it loads * the table into memory and returns a pointer to it. if errors are found * it returns a null pointer. It is called by lou_translateString and * lou_backTranslateString and also by functions in liblouisxml */ int EXPORT_CALL lou_compileString (const char *tableList, const char *inString); char * EXPORT_CALL lou_setDataPath (char *path); char * EXPORT_CALL lou_getDataPath (void); typedef void (*logcallback)(int level, const char *message); void EXPORT_CALL lou_registerLogCallback(logcallback callback); /* Register logging callbacks, * Set to NULL for default callback. */ typedef enum { LOG_ALL = -2147483648, LOG_DEBUG = 10000, LOG_INFO = 20000, LOG_WARN = 30000, LOG_ERROR = 40000, LOG_FATAL = 50000, LOG_OFF = 2147483647 } logLevels; void EXPORT_CALL lou_setLogLevel(logLevels level); void EXPORT_CALL lou_log(logLevels level, const char *format, ...); /* General log function for callback logging */ void EXPORT_CALL lou_free (void); /* This function should be called at the end of * the application to free all memory allocated by liblouis. */ #ifdef __cplusplus } #endif /* __cplusplus */ #endif /*LibLOUIS_H_ */