I did all that and verified the c++ swig call was used and g++ on javaJAVA_wrap.cxx. I also needed the fix in PROTON-249 to progress on Windows.
Let me know if you have made further progress. Otherwise, I will keep digging. Cliff On Fri, Mar 1, 2013 at 4:31 AM, Phil Harvey <[email protected]> wrote: > Hi Cliff, > > Thanks for looking into this. > > Simply setting the BUILD_WITH_CXX flag with a clean checkout doesn't expose > the problem because it doesn't affect the language that Swig uses. You'd > need to also: > > - Edit bindings/java/CMakeLists.txt to tell Swig to honour the > BUILD_WITH_CXX flag and use C++ rather than C when generating the > proton-jni code, like so: > > if (BUILD_WITH_CXX) > SET_SOURCE_FILES_PROPERTIES(java.i PROPERTIES CPLUSPLUS ON) > endif (BUILD_WITH_CXX) > > - Fix (or comment out) the offending lines in the generated code that > violate C++'s stricter rules around casting void*'s etc. I'm not expecting > you to actually do this ... unless you're feeling *really* keen :-) > > This allows the build to Swig-generate and compile the proton-jni C++ and > Java code. However, the Java code that uses it fails to compile because > Swig didn't generate the pn_atom_t_u Java class, due to its lack of support > for nested unions in typedefs. > > It's all rather convoluted, but hopefully that clarifies the problem > somewhat. > > > Phil > > Not sure if that clears > > > On 1 March 2013 08:47, Cliff Jansen <[email protected]> wrote: > >> I am trying to catch up with you to reproduce your problem. So far I >> can build on linux with "cmake -DBUILD_WITH_CXX=ON". That works, so >> we know the problem is unrelated to swig itself or the switch to C++. >> It is either some problem with Visual Studio or a lack of strictness >> with g++. >> >> The warning you are seeing is from the Visual C++ compiler, and is >> just a warning. It is indeed a high profile suspect, but perhaps a >> red herring also. >> >> Right now I am trying to untangle the exact steps cmake is feeding >> into the vcxproj file so that I can compile the swig generated file by >> hand and zero in on the problem. But I don't claim to be in a better >> position to solve this than you. I doubt I will progress this much >> before the end of my day here. If you make further progress, let me >> know so that we can minimise duplicated effort. >> >> Cliff >> >> On Thu, Feb 28, 2013 at 11:41 AM, Phil Harvey <[email protected]> >> wrote: >> > I have been working with Keith on PROTON-249 ("Build fails on Win8 / VS >> > 2012 with path error" [1]). When building Proton from MS Visual Studio, >> we >> > understand that a C++ (rather than C) compiler is used. >> > >> > We therefore tried doing a C++ build on Linux as a first step >> (i.e.running >> > cmake with -DBUILD_WITH_CXX=ON), and ran into a number of problems - see >> > PROTON-254 [2]. Most of the problems relate to the stricter rules in C++ >> > around casting etc, and are easy to fix. >> > >> > However, the fact that Swig doesn't support nested unions in C++ >> typedef's >> > means that it doesn't generate Java class pn_atom_t_u, which is our >> > hand-written Java code depends on. >> > >> > We're interested in opinions about the best way forward, particularly >> from >> > anyone who faced similar problems when building the other language >> bindings >> > using C++. >> > >> > Thanks, >> > Phil >> > >> > [1] https://issues.apache.org/jira/browse/PROTON-249 >> > [2] https://issues.apache.org/jira/browse/PROTON-254 >>
