Instalación de Freeling4 en Windows

Submitted by andreadiazg9 on Tue, 01/23/2018 - 19:11
Forums

Hello,

I'm building the Java API in Windows
And I've done the steps

    1. Install java

    2. Download and install Swig (http://www.swig.org/)

    3. Run swig with freeling_javaAPI.i to generate the API
       SWIG will generate an edu / upc / freeling directory with the Java API
       for all the modules, and a file freeling_javaAPI.cxx with the JNI side
       of the API.

    4. Compile the Java code in edu / upc / freeling and create a freeling.jar file
       with the results.

BUT ON ARRIVING AT THIS STEP, I DO NOT UNDERSTAND WHAT MUST BE DONE.
    5. Compile freeling_javaAPI.cxx into a DLL (using MSVC or any other compiler).
       You should provide routes to the include directories of freeling and treeler,
       and Java headers (jni.h etc.)
       
       You will get a library freeling_javaAPI.dll to load from
       your Java programs

I tried running the following command:
C:\Tesis\swigwin-3.0.12>freeling_javaAPI.cxx /I"C:\Program Files\Java\jdk1.8.0_121\include" /I"C:\Program Files\Java\jdk1.8.0_121\include\win32" /I"C:\Tesis\freeling\include" / I"C:\Tesis\freeling\dependencies\boost\include" /I"C:\Tesis\freeling\dependencies\icu\include" /I"C:\Tesis\freeling\dependencies\zlib\include"

BUT NOTHING HAPPENS
ANY IDEAS?
THANKS

freeling_javaAPI.cxx   is a C++ source code that bridges between your java program and FreeLing  C++ data structures.

So, you need a C++ compiler (e.g. MSVC) to convert this C++ program to a binary library (DLL) that can be used.

In the same way you can not execute a .java source program without first compiling it into a .class file using a java compiler (javac), you can not execute a C++ source without first compiling it into an executable file (.exe or .dll) with a C++ compiler (e.g. visual studio or the like)

 

Thanks for your comment, it has done what it says and I am compiling the following command with VS 2013:

I AM USING CL.EXE

CL/LD freeling_javaAPI.cxx /I"C:\Program Files\Java\jdk1.8.0_121\include" /I"C:\Program Files\Java\jdk1.8.0_121\include\win32" /I"C:\Tesis\freeling\include" /I"C:\Tesis\freeling\dependencies\boost\include" /I"C:\Tesis\freeling\dependencies\icu\include" /I"C:\Tesis\freeling\dependencies\zlib\include" /I"C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include"

BUT THE FOLLOWING ERROR APPEARS:

Microsoft (R) C/C++ Optimizing Compiler Version 18.00.21005.1 for x86
Copyright (C) Microsoft Corporation. All rights reserved.

freeling_javaAPI.cxx
C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\xlocale(337) : warning C4530: C++ exception handler used, but unwind semantics are not enabled. Specify /EHsc
c:\tesis\freeling\include\freeling/morfo/util.h(162) : error C3861: 'getpid': identifier not found
C:\Tesis\freeling\dependencies\boost\include\boost/type_traits/common_type.hpp(42) : fatal error C1903: unable to recover from previous error(s); stopping compilation

Any idea?

Compiling FreeLing in windows is not an easy task.  It requires deep knowledge of C++ and specially deep knowledge of MSVC.

I am preparing an easier to install version of the APIs, but I am not MSVC expert, so I can not help you here

Maybe it would be easier to install a Linux machine than going trough all this suffering.. ;-)

I set up a new installation method for FreeLing that will work easily on windows, and also build the APIs.

Please pull latest github master version and follow instructions in INSTALL.windows

Let me know how it works