entropia / libsocket-can-java

SocketCAN JNI wrapper
MIT License
44 stars 49 forks source link

Makefile gnu compiler version? #2

Closed alexhdzherdocia closed 11 years ago

alexhdzherdocia commented 11 years ago

I ran make and get this:

g++ -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -fPIC -Wall -pedantic -std=gnu++11 -D_REENTRANT -D_GNU_SOURCE -I/opt/java/jdk1.7.0/include -I/opt/java/jdk1.7.0/include/linux -Wl,-soname,jni_socketcan -shared -o lib/libjni_socketcan.so \ jni/cansocket.cpp jni/cansocket.cpp: In function ‘jint Java_de_entropia_can_CanSocket1fetch_1CAN1MTU(JNIEnv, jclass)’: jni/cansocket.cpp:275:9: error: ‘CAN_MTU’ was not declared in this scope jni/cansocket.cpp: In function ‘jint Java_de_entropia_can_CanSocket1fetch_1CAN_1FD1MTU(JNIEnv, jclass)’: jni/cansocket.cpp:281:9: error: ‘CANFD_MTU’ was not declared in this scope jni/cansocket.cpp: In function ‘jint Java_de_entropia_can_CanSocket1fetch_1CAN_1RAW_1FD1FRAMES(JNIEnv, jclass)’: jni/cansocket.cpp:312:9: error: ‘CAN_RAW_FD_FRAMES’ was not declared in this scope jni/cansocket.cpp:313:1: warning: control reaches end of non-void function [-Wreturn-type] jni/cansocket.cpp: In function ‘jint Java_de_entropia_can_CanSocket1fetch_1CAN_1FD1MTU(JNIEnv, jclass)’: jni/cansocket.cpp:282:1: warning: control reaches end of non-void function [-Wreturn-type] jni/cansocket.cpp: In function ‘jint Java_de_entropia_can_CanSocket__1fetch_1CAN1MTU(JNIEnv, jclass)’: jni/cansocket.cpp:276:1: warning: control reaches end of non-void function [-Wreturn-type] make: _\ [stamps/compile-jni] Error 1

I'm using Kernel version 2.6.32-45-generic and gnu compiler version 4.7 in Ubuntu 10.04. Are these errors due to the "experimental" support of -std=gnu++11 ?

Cheers.

hannes-zz commented 11 years ago

No, unfortunately your kernel is too old. CAN_MTU, CANFD_MTU and CAN_RAW_FD_FRAMES were introduced in kernel v3.5. I will have a look if I can provide a sane workaround later on.

hannes-zz commented 11 years ago

CAN FD support actually needs a v3.6 kernel. I added a workaround to the master branch. Could you test it?

alexhdzherdocia commented 11 years ago

it compiles. Functionality is still to be tested.

The output is:

g++ -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -fPIC -Wall -pedantic -std=gnu++11 -D_REENTRANT -D_GNU_SOURCE -I/opt/java/jdk1.7.0/include -I/opt/java/jdk1.7.0/include/linux -Wl,-soname,jni_socketcan -shared -o lib/libjni_socketcan.so \ jni/cansocket.cpp jni/cansocket.cpp:20:2: warning: #warning is a GCC extension [enabled by default] jni/cansocket.cpp:20:2: warning: #warning "CAN FD support only available since v3.6. Please consider to update." [-Wcpp] /opt/java/jdk1.7.0/bin/jar cMf dist/libsocket-can-java.jar lib -C classes . /opt/java/jdk1.7.0/bin/javac -g -Xlint:all -cp classes -d classes.test \ src.test/de/entropia/can/CanSocketTest.java

Cheers!

Alex.