You are viewing a plain text version of this content. The canonical link for it is here.
Posted to proton@qpid.apache.org by "Keith Wall (JIRA)" <ji...@apache.org> on 2013/02/28 16:07:12 UTC

[jira] [Updated] (PROTON-254) Swig generated c code for java bindings fails to compile on Windows Visual Studio 2010

     [ https://issues.apache.org/jira/browse/PROTON-254?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Keith Wall updated PROTON-254:
------------------------------

    Description: 
Swig generated C code for the Java bindings fails to compile on Visual Studio 2010 with error message:

C1083: Cannot open include file: 'stdbool.h': No such file or directory

After discussion on list [1], we tried changing bindings/java/CMakeLists.txt to use CPLUSPLUS ON directive to CMake in the case where BUILD_WITH_CXX has been enabled earlier in the build.

if (BUILD_WITH_CXX)
     SET_SOURCE_FILES_PROPERTIES(python.i PROPERTIES CPLUSPLUS ON)
  endif (BUILD_WITH_CXX)

Switching to CPP in this way exposed a number of errors when compiling the CPP code resulting from the java.i (casting issues, pointer arithemetic etc - see attached make-proton-jni.txt).  However, even after resolving the CPP compilation issues, we then encounter a problem with Swig's handling of nested unions when when CPP.  The seeming inability of SWIG (when used with CPP) to represent the union means that SWIG does not produce pn_atom_t_u.java.  JNIMessage.java, which references pn_atom_t_u, consequently fails to compile.

The warning from swig is:

/home/keith/src/proton/proton-c/include/proton/codec.h:91: Warning 312: Nested union not currently supported (ignored).

 
[1] http://mail-archives.apache.org/mod_mbox/qpid-proton/201302.mbox/%3CCAMyv19mgbdvD2wexTvpwywtySsKADOKB7Wtj+U-3jkncWdXehg@mail.gmail.com%3E






  was:
Swig generated C code for the Java bindings fails to compile on Visual Studio 2010 with error message:

C1083: Cannot open include file: 'stdbool.h': No such file or directory

After discussion on list [1], we tried changing bindings/java/CMakeLists.txt to use CPLUSPLUS ON directirve to CMake in the case where BUILD_WITH_CXX has been enabled eariler in the build.

if (BUILD_WITH_CXX)
     SET_SOURCE_FILES_PROPERTIES(python.i PROPERTIES CPLUSPLUS ON)
  endif (BUILD_WITH_CXX)

Switching to CPP in this way exposed a number of errors when compiling the CPP code resulting from the java.i (casting issues, pointer arithemetic etc).  However, even after resolving the CPP compilation issues, we then encounter a problem with Swig's handling of nested unions when when CPP.  The seeming inability of SWIG (when used with CPP) to represent the union means that SWIG does not produce pn_atom_t_u.java, and subsequently, JNIMessage.java fails to compile.

<<errors to be inserted>>
 
[1] http://mail-archives.apache.org/mod_mbox/qpid-proton/201302.mbox/%3CCAMyv19mgbdvD2wexTvpwywtySsKADOKB7Wtj+U-3jkncWdXehg@mail.gmail.com%3E






    
> Swig generated c code for java bindings fails to compile on Windows Visual Studio 2010
> --------------------------------------------------------------------------------------
>
>                 Key: PROTON-254
>                 URL: https://issues.apache.org/jira/browse/PROTON-254
>             Project: Qpid Proton
>          Issue Type: Bug
>          Components: proton-c
>    Affects Versions: 0.4
>         Environment: Windows 7
> Visual Studio 2010
>            Reporter: Keith Wall
>         Attachments: make-proton-jni-cxx-errors.txt
>
>
> Swig generated C code for the Java bindings fails to compile on Visual Studio 2010 with error message:
> C1083: Cannot open include file: 'stdbool.h': No such file or directory
> After discussion on list [1], we tried changing bindings/java/CMakeLists.txt to use CPLUSPLUS ON directive to CMake in the case where BUILD_WITH_CXX has been enabled earlier in the build.
> if (BUILD_WITH_CXX)
>      SET_SOURCE_FILES_PROPERTIES(python.i PROPERTIES CPLUSPLUS ON)
>   endif (BUILD_WITH_CXX)
> Switching to CPP in this way exposed a number of errors when compiling the CPP code resulting from the java.i (casting issues, pointer arithemetic etc - see attached make-proton-jni.txt).  However, even after resolving the CPP compilation issues, we then encounter a problem with Swig's handling of nested unions when when CPP.  The seeming inability of SWIG (when used with CPP) to represent the union means that SWIG does not produce pn_atom_t_u.java.  JNIMessage.java, which references pn_atom_t_u, consequently fails to compile.
> The warning from swig is:
> /home/keith/src/proton/proton-c/include/proton/codec.h:91: Warning 312: Nested union not currently supported (ignored).
>  
> [1] http://mail-archives.apache.org/mod_mbox/qpid-proton/201302.mbox/%3CCAMyv19mgbdvD2wexTvpwywtySsKADOKB7Wtj+U-3jkncWdXehg@mail.gmail.com%3E

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira