1

I have been attempting to install Kvaser drivers onto a RPI 2B and have been follwing the instructions listed in the following link:

https://www.kvaser.com/developer-blog/building-canlib-linuxcan-raspberry-pi/

However, when I get to the step in which I need to type in the "make" command, I get the following messages.

building kvcommon  Kernel src: /home/pi/linuxcan/linux-4153f509b449f1c1c816cf124c314975c3daa824 make
-C /home/pi/linuxcan/linux-4153f509b449f1c1c816cf124c314975c3daa824 SUBDIRS=/home/pi/linuxcan/linuxcan/common modules make[2]: Entering directory '/home/pi/linuxcan/linux-4153f509b449f1c1c816cf124c314975c3daa824'   CC [M]  /home/pi/linuxcan/linuxcan/common/VCanOsIf.o   CC [M]  /home/pi/linuxcan/linuxcan/common/objbuf.o   CC [M]  /home/pi/linuxcan/linuxcan/common/osif_functions_kernel.o   CC [M]  /home/pi/linuxcan/linuxcan/common/queue.o   CC [M]  /home/pi/linuxcan/linuxcan/common/util.o In file included from ./arch/arm/include/asm/div64.h:126:0,
                 from ./include/linux/kernel.h:142,
                 from ./include/linux/list.h:8,
                 from ./include/linux/module.h:9,
                 from /home/pi/linuxcan/linuxcan/common/util.c:53: /home/pi/linuxcan/linuxcan/common/util.c: In function ‘packed_EAN_to_BCD’: ./include/asm-generic/div64.h:207:28: error: comparison of distinct pointer types lacks a cast [-Werror]   (void)(((typeof((n)) *)0) == ((uint64_t *)0)); \
                            ^ /home/pi/linuxcan/linuxcan/common/util.c:87:10: note: in expansion of macro ‘do_div’
     c1 = do_div(ean64, 10);
          ^~~~~~ ./include/asm-generic/div64.h:207:28: error: comparison of distinct pointer types lacks a cast [-Werror]   (void)(((typeof((n)) *)0) == ((uint64_t *)0)); \
                            ^ /home/pi/linuxcan/linuxcan/common/util.c:88:10: note: in expansion of macro ‘do_div’
     c2 = do_div(ean64, 10);
          ^~~~~~ /home/pi/linuxcan/linuxcan/common/util.c: In function ‘packed_EAN_to_BCD_with_csum’: ./include/asm-generic/div64.h:207:28: error: comparison of distinct pointer types lacks a cast [-Werror]   (void)(((typeof((n)) *)0) == ((uint64_t *)0)); \
                            ^ /home/pi/linuxcan/linuxcan/common/util.c:125:9: note: in expansion of macro ‘do_div’
     x = do_div(tmp, 10);
         ^~~~~~ ./include/asm-generic/div64.h:207:28: error: comparison of distinct pointer types lacks a cast [-Werror]   (void)(((typeof((n)) *)0) == ((uint64_t *)0)); \
                            ^ /home/pi/linuxcan/linuxcan/common/util.c:144:10: note: in expansion of macro ‘do_div’
     c1 = do_div(ean64, 10);
          ^~~~~~ ./include/asm-generic/div64.h:207:28: error: comparison of distinct pointer types lacks a cast [-Werror]   (void)(((typeof((n)) *)0) == ((uint64_t *)0)); \
                            ^ /home/pi/linuxcan/linuxcan/common/util.c:145:10: note: in expansion of macro ‘do_div’
     c2 = do_div(ean64, 10);
          ^~~~~~ cc1: all warnings being treated as errors scripts/Makefile.build:293: recipe for target '/home/pi/linuxcan/linuxcan/common/util.o' failed make[3]: *** [/home/pi/linuxcan/linuxcan/common/util.o] Error 1 Makefile:1493: recipe for target '_module_/home/pi/linuxcan/linuxcan/common' failed make[2]: *** [_module_/home/pi/linuxcan/linuxcan/common] Error 2 make[2]: Leaving directory '/home/pi/linuxcan/linux-4153f509b449f1c1c816cf124c314975c3daa824' /home/pi/linuxcan/linuxcan/common/../config.mak:135: recipe for target 'kv_module' failed make[1]: *** [kv_module] Error 2 make[1]: Leaving directory '/home/pi/linuxcan/linuxcan/common' Makefile:94: recipe for target 'common' failed make: *** [common] Error 2

I have been trying to research into some of these error messages, but I wanted to know if someone already knew a solution to this issue.

0

This is not a solution but rather a work-around:

Edit config.mak in linuxcan directory to remove the -Werror compiler flag.

try make again. Watch for warnings.

|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.