You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@Properties(
value = {
@Platform(
include = {
"test.h",
}
),
}
)
public class Test implements InfoMapper {
@Override
public void map(InfoMap infoMap) {
}
}
Compilation of this example fails with error:
[INFO] g++ -I/path.../include/ -I/usr/lib/jvm/java-11-openjdk/include -I/usr/lib/jvm/java-11-openjdk/include/linux /path.../jniString.cpp /path.../jnijavacpp.cpp -march=x86-64 -m64 -O3 -s -Wl,-rpath,$ORIGIN/ -Wl,-z,noexecstack -Wl,-Bsymbolic -Wall -fPIC -pthread -shared -o libjniString.so -L/path.../lib/ -Wl,-rpath,/path.../lib/
/path.../jniString.cpp: In function ‘void Java_org_bytedeco_baumer_String_allocate__Lorg_bytedeco_baumer_String_2I(JNIEnv*, jobject, jobject, jint)’:
/path.../jniString.cpp:469:45: error: no matching function for call to ‘String::String(String*&, jint&)’
469 | String* rptr = new String(ptr0, arg1);
| ^
In file included from /path.../jniString.cpp:92:
/path.../include/test.h:22:1: note: candidate: ‘String::String(const char*, int)’
22 | String::String(const char *text, int length) {
| ^~~~~~
/path.../include/test.h:22:28: note: no known conversion for argument 1 from ‘String*’ to ‘const char*’
22 | String::String(const char *text, int length) {
| ~~~~~~~~~~~~^~~~
/path.../include/test.h:2:7: note: candidate: ‘constexpr String::String(const String&)’
2 | class String {
| ^~~~~~
/path.../include/test.h:2:7: note: candidate expects 1 argument, 2 provided
/path.../include/test.h:2:7: note: candidate: ‘constexpr String::String(String&&)’
/path.../include/test.h:2:7: note: candidate expects 1 argument, 2 provided
/path.../jniString.cpp: In function ‘_jobject* Java_org_bytedeco_baumer_String_asBytePointer(JNIEnv*, jobject)’:
/path.../jniString.cpp:492:42: error: cast from ‘char*’ to ‘char’ loses precision [-fpermissive]
492 | rptr = (char)ptr->operator char*();
| ^
/path.../jniString.cpp:493:21: warning: NULL used in arithmetic [-Wpointer-arith]
493 | if (rptr != NULL) {
| ^~~~
The text was updated successfully, but these errors were encountered:
file test.h:
preset class Test.java:
Compilation of this example fails with error:
The text was updated successfully, but these errors were encountered: