Hi Gregg,

This testifies that there is a mismatch in a set of supported values between 
the JObjectConverter structure inside of 
<iotivity>/java/jni/JniOcRepresentation.h and AttributeValue in 
<iotivity>/resource/include/AttributeValue.h

Most likely, it is missing the JNI portions of this patch 
https://gerrit.iotivity.org/gerrit/#/c/7937/ .
Since 7895 reshuffles files around, the above patch cannot be directly applied 
underneath of it and will require a manual propagation to the new locations of 
the modified components.

Best regards,

Tim Kourt
Intel Open Source Technology Center


From: iotivity-dev-bounces at lists.iotivity.org 
[mailto:iotivity-dev-boun...@lists.iotivity.org] On Behalf Of Gregg Reynolds
Sent: Monday, June 13, 2016 11:30 AM
To: iotivity-dev <iotivity-dev at lists.iotivity.org>
Subject: [dev] Jni bug: need c++ help

I'm trying to compile the Jni code (from 
https://gerrit.iotivity.org/gerrit/#/c/7895/) on Darwin and I've hit a brick 
wall. I don't know C++/Boost thoroughly enough to see what's going on here:

g++ -o out/darwin/x86_64/release/java/jni/JniOcRepresentation.os -c -std=c++11 
-Wall -Wextra -Werror -pthread -mmacosx-version-min=10.10 -D__JAVA__ -Os 
-Wno-error -Wno-comment -Wno-unused-function -Wno-unused-parameter -fPIC -fPIC 
-Wall -Wno-unused -Wno-#pragma-messages -Os -DNDEBUG -DIP_ADAPTER 
-DNO_EDR_ADAPTER -DNO_LE_ADAPTER -DWITH_POSIX -D_DARWIN_C_SOURCE -DROUTING_EP 
-DWITH_BWT -DEASY_SETUP_CA_INIT -DREMOTE_ARDUINO_ENROLEE -DCPP_MEDIATOR 
-Iresource/c_common/oic_time/include 
-Iresource/csdk/connectivity/lib/libcoap-4.1.1 
-Iresource/c_common/oic_malloc/include -Iout/darwin/x86_64/release/java/api 
-Ijava/api -I/usr/local/include 
-I/Library/Java/JavaVirtualMachines/jdk1.8.0_91.jdk/Contents/Home/include 
-I/Library/Java/JavaVirtualMachines/jdk1.8.0_91.jdk/Contents/Home/include/linux 
-Iextlibs/tinycbor/tinycbor/src 
-Iout/darwin/x86_64/release/resource/csdk/logger/include 
-Iresource/csdk/logger/include -Iout/darwin/x86_64/release/resource/c_common 
-Iresource/c_common 
-Iout/darwin/x86_64/release/resource/c_common/oic_malloc/include 
-Iresource/c_common/oic_malloc/include 
-Iout/darwin/x86_64/release/resource/c_common/oic_string/include 
-Iresource/c_common/oic_string/include 
-Iout/darwin/x86_64/release/resource/c_common/oic_time/include 
-Iresource/c_common/oic_time/include 
-Iout/darwin/x86_64/release/resource/c_common/ocrandom/include 
-Iresource/c_common/ocrandom/include -Iout/darwin/x86_64/release/java/inc 
-Ijava/inc -Iout/darwin/x86_64/release/java/lib/libcoap-4.1.1 
-Ijava/lib/libcoap-4.1.1 -I/resource/csdk/logger/include 
-Iout/darwin/x86_64/release/java/common/inc -Ijava/common/inc 
-Iout/darwin/x86_64/release/java/util/inc -Ijava/util/inc 
-Iout/darwin/x86_64/release/java/jni/common/inc -Ijava/jni/common/inc 
-Iresource/csdk/logger/include 
-I/Library/Java/JavaVirtualMachines/jdk1.8.0_91.jdk/Contents/Home/include/darwin
 -Iout/darwin/x86_64/release/resource/csdk/routing/include 
-Iresource/csdk/routing/include -Iplugins/include -Iplugins/include/internal 
-Iresource/oc_logger/include -Iresource/csdk/stack/include 
-Iresource/csdk/logger/include -Iresource/c_common/oic_string/include 
-Iplugins/zigbee_wrapper/telegesis_wrapper/include 
-Iplugins/zigbee_wrapper/include -Iresource/csdk/connectivity/api 
-Iresource/include -Iresource/c_common -Iresource/csdk/ocsocket/include 
-Iextlibs/boost/boost_1_58_0 -Ibuild_common/android/compatibility 
-Iresource/csdk/security/provisioning/include 
-Iresource/csdk/security/provisioning/include/oxm 
-Iresource/csdk/security/provisioning/include/internal 
-Iresource/csdk/security/include java/jni/JniOcRepresentation.cpp
In file included from java/jni/JniOcRepresentation.cpp:22:
In file included from java/jni/JniOcRepresentation.h:21:
In file included from java/jni/JniOcStack.h:23:
In file included from resource/include/OCApi.h:37:
In file included from resource/include/OCRepresentation.h:37:
In file included from resource/include/AttributeValue.h:36:
In file included from /usr/local/include/boost/variant.hpp:17:
/usr/local/include/boost/variant/variant.hpp:978:16: error: no matching 
function for call to object of type 'const JObjectConverter'
        return visitor_(operand);
               ^~~~~~~~
...snip template expansions...
   return boost::apply_visitor(JObjectConverter(env), attrValue);
                  ^
java/jni/JniOcRepresentation.h:39:13: note: candidate function not viable: no 
known conversion from 'std::__1::vector<unsigned char, 
std::__1::allocator<unsigned char> >' to 'const OC::NullType' for 1st argument
    jobject operator()(const NullType&) const { return nullptr; }
            ^
java/jni/JniOcRepresentation.h:40:13: note: candidate function not viable: no 
known conversion from 'std::__1::vector<unsigned char, 
std::__1::allocator<unsigned char> >' to 'const int' for 1st argument
    jobject operator()(const int& val) const
            ^
... etc., one msg per sig in JObjectConverter....

So the problem seems to be a typing incompatibility in the use of apply_visitor 
in JniOcRepresentation.  That's about as far as I can get.

Any suggestions?

Thanks,
Gregg
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 
<http://lists.iotivity.org/pipermail/iotivity-dev/attachments/20160613/f3c6b39f/attachment.html>

Reply via email to