compilation error when building JNILIBRARY on cygwin

28 views
Skip to first unread message

Jean-Philippe Goldman

unread,
Dec 4, 2018, 4:22:24 PM12/4/18
to Unitex-GramLab
I'm trying to build unitex + jnilibrary on cygwin with this command

make SYSTEM=Windows 64BITS=yes library=yes TRE_DIRECT_COMPILE=yes JNILIBRARY=yes ADDITIONAL_INCLUDE='/cygdrive/c/Program\ Files/Java/jdk-11.0.1/include' ADDITIONAL_INCLUD E2='/cygdrive/c/Program\ Files/Java/jdk-11.0.1/include/win32' ADDITIONAL_CFLAG='-D__int64=long\ long' DEBUG=yes UNITEXTOOLLOGGERONLY=yes

but I get this compilation error
g++.exe -c -I"C:/Program\ Files\ (x86)/Dev-Cpp/include" -I"../include_tre" -I".."  -Wall -g -O0 -I/cygdrive/c/Program\ Files/Java/jdk-11.0.1/include -I/cygdrive/c/Program\ 
Files/Java/jdk-11.0.1/include/win32 -D__int64=long\ long -DUNITEXTOOL_TOOL_FROM_LOGGER -DUNITEX_LIBRARY -DUNITEXTOOL_TOOL_FROM_LOGGER ../UnitexLibDirWin.cpp
In file included from ../UnitexLibDirWin.cpp:54:0:                                                                                                                          
/usr/include/w32api/strsafe.h: Dans la fonction « HRESULT StringVPrintfWorkerA(STRSAFE_LPSTR, size_t, STRSAFE_LPCSTR, va_list) »:                                           
/usr/include/w32api/strsafe.h:1555:12: error: « _vsnprintf » n'a pas été déclaré dans cette portée                                                                          
     iRet = _vsnprintf(pszDest,cchMax,pszFormat,argList);                                                                                                                   
            ^~~~~~~~~~                                        
also these ones are missing : _vsnwprintf, getwc and WOEF

any idea of this incompatibility or any magic flag to find a workaround ?

Note that this usual build is working fine: make DEBUG=yes UNITEXTOOLLOGGERONLY=yes TRE_DIRECT_COMPILE=yes  

many thanks in advance to whom can save me days...

Gilles Vollant

unread,
Dec 4, 2018, 6:22:11 PM12/4/18
to Jean-Philippe Goldman, Unitex-GramLab

Try add this compilation option

 

ADDITIONAL_CFLAG='-DUNITEX_PREVENT_USING_WINRT_API'

 

De : unitex-...@googlegroups.com [mailto:unitex-...@googlegroups.com] De la part de Jean-Philippe Goldman
Envoyé : mardi 4 décembre 2018 22:22
À : Unitex-GramLab
Objet : [Unitex-GramLab] compilation error when building JNILIBRARY on cygwin

 

--
You received this message because you are subscribed to the Google Groups "Unitex-GramLab" group.
To unsubscribe from this group and stop receiving emails from it, send an email to unitex-gramla...@googlegroups.com.
To post to this group, send email to unitex-...@googlegroups.com.
Visit this group at https://groups.google.com/group/unitex-gramlab.
To view this discussion on the web visit https://groups.google.com/d/msgid/unitex-gramlab/a9c8696e-af45-44fb-8c09-ff0f0a1eee59%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Jean-Philippe Goldman

unread,
Dec 5, 2018, 5:03:36 AM12/5/18
to Unitex-GramLab
many thanks. i got a step further. now i get this error about direct.h (which is Windows related if I remember correctly)

g++.exe -c ../logger/UnpackFileTool.cpp -L"."    -I"C:/Program\ Files\ (x86)/Dev-Cpp/include" -I"../include_tre" -I".."  -Wall -g -O0 -I/cygdrive/c/Program\ Files/Java/jdk-
11.0.1/include -I/cygdrive/c/Program\ Files/Java/jdk-11.0.1/include/win32 -D__int64=long\ long -DUNITEX_PREVENT_USING_WINRT_API -DUNITEXTOOL_TOOL_FROM_LOGGER -DUNITEX_LIBRA
RY -DUNITEXTOOL_TOOL_FROM_LOGGER                                                                                                                                            
In file included from ../logger/UnpackFileTool.cpp:26:0:                                                                                                                    
../File.h:57:12: erreur fatale: direct.h : No such file or directory                                                                                                        
   #include <direct.h>  // mkdir()                                                                                                                                          
            ^~~~~~~~~~                                                                                                                                                      
compilation terminée.                                                                                                                                                       
make: *** [Makefile:2078: UnpackFileTool.o] Error 1                                                                                                                         
any idea to solve this ? 
thanks in advance
jp

Gilles Vollant

unread,
Dec 5, 2018, 6:24:32 AM12/5/18
to Jean-Philippe Goldman, Unitex-GramLab

If you replace direct.h by unistd.h on line 57 of file.h , is it better?

 

De : unitex-...@googlegroups.com [mailto:unitex-...@googlegroups.com] De la part de Jean-Philippe Goldman
Envoyé : mercredi 5 décembre 2018 11:04
À : Unitex-GramLab
Objet : Re: [Unitex-GramLab] compilation error when building JNILIBRARY on cygwin

Jean-Philippe Goldman

unread,
Dec 5, 2018, 9:36:14 AM12/5/18
to Gilles Vollant, Unitex-GramLab
thanks for the help
it gets way further but bumps into this

g++.exe -c -I"C:/Program\ Files\ (x86)/Dev-Cpp/include" -I"../include_tre" -I".."  -Wall -g -O0 -I/cygdrive/c/Program\ Files/Java/jdk-11.0.1/include -I/cygdrive/c/Program\ 
Files/Java/jdk-11.0.1/include/win32 -D__int64=long\ long -DUNITEX_PREVENT_USING_WINRT_API -DUNITEXTOOL_TOOL_FROM_LOGGER -DUNITEX_LIBRARY -DUNITEXTOOL_TOOL_FROM_LOGGER ../Fi
le.cpp
../File.cpp: Dans la fonction « int unitex::get_real_path(const char*, char*) »:                                                                                            
../File.cpp:401:6: error: « _wfullpath » n'a pas été déclaré dans cette portée                                                                                              
  if (_wfullpath(w_buffer, w_filename, FILENAME_MAX)) {                                                                                                                     
      ^~~~~~~~~~                                                                                                                                                            
../File.cpp:401:6: note: alternatives suggérées: « FillPath »                                                                                                               
  if (_wfullpath(w_buffer, w_filename, FILENAME_MAX)) {                                                                                                                     
      ^~~~~~~~~~                                                                                                                                                            
      FillPath                                                                                                                                                              
make: *** [Makefile:1858: File.o] Error 1                                                                                                                                   
--
j:-P  
Reply all
Reply to author
Forward
0 new messages