ld error while compling test code

This forum covers PCAN-Linux and Linux development issues concerning our products
Post Reply
Magnus.Z
Posts: 7
Joined: Mon 2. May 2022, 11:24

ld error while compling test code

Post by Magnus.Z » Wed 7. Sep 2022, 13:57

Hi, we are using peak-linux-driver-8.14.0 on raspberry CM4. It's installed and we run the receivetest and transmitest without problem. I tried to rename transmitest.cpp and then run "make -C test" and I got ld error for the transmitest.cpp I rename it back as it was but I got the same error. The output of "make -C test" is :

Code: Select all

ev@raspberrypi:~/peak-linux-driver-8.14.0 $ make -C test
make: Entering directory '/home/ev/peak-linux-driver-8.14.0/test'
Makefile:205: warning: overriding recipe for target 'transmitest'
Makefile:187: warning: ignoring old recipe for target 'transmitest'
***
*** Making example and test programs
***
*** gcc version: 10
***
g++ -DNO_RT -I. -I../lib -I../driver  -g  -lpcanfd  -L../lib/lib -Wl,-rpath ../lib/lib  src/transmitest.cpp   -o src/transmitest
/usr/bin/ld: /tmp/ccvdVnOm.o: in function `do_exit(int)':
/home/ev/peak-linux-driver-8.14.0/test/src/transmitest.cpp:58: undefined reference to `print_diag'
/usr/bin/ld: /home/ev/peak-linux-driver-8.14.0/test/src/transmitest.cpp:59: undefined reference to `CAN_Close'
/usr/bin/ld: /tmp/ccvdVnOm.o: in function `write_loop(unsigned int, unsigned int)':
/home/ev/peak-linux-driver-8.14.0/test/src/transmitest.cpp:103: undefined reference to `CAN_Write'
/usr/bin/ld: /tmp/ccvdVnOm.o: in function `main':
/home/ev/peak-linux-driver-8.14.0/test/src/transmitest.cpp:153: undefined reference to `parser::parser()'
/usr/bin/ld: /home/ev/peak-linux-driver-8.14.0/test/src/transmitest.cpp:159: undefined reference to `disclaimer'
/usr/bin/ld: /home/ev/peak-linux-driver-8.14.0/test/src/transmitest.cpp:188: undefined reference to `getTypeOfInterface'
/usr/bin/ld: /home/ev/peak-linux-driver-8.14.0/test/src/transmitest.cpp:248: undefined reference to `parser::setFileName(char const*)'
/usr/bin/ld: /home/ev/peak-linux-driver-8.14.0/test/src/transmitest.cpp:257: undefined reference to `getNameOfInterface'
/usr/bin/ld: /home/ev/peak-linux-driver-8.14.0/test/src/transmitest.cpp:304: undefined reference to `parser::Messages[abi:cxx11]()'
/usr/bin/ld: /home/ev/peak-linux-driver-8.14.0/test/src/transmitest.cpp:307: undefined reference to `parser::nGetLastError()'
/usr/bin/ld: /home/ev/peak-linux-driver-8.14.0/test/src/transmitest.cpp:315: undefined reference to `LINUX_CAN_Open'
/usr/bin/ld: /home/ev/peak-linux-driver-8.14.0/test/src/transmitest.cpp:330: undefined reference to `CAN_Open'
/usr/bin/ld: /home/ev/peak-linux-driver-8.14.0/test/src/transmitest.cpp:333: undefined reference to `getNameOfInterface'
/usr/bin/ld: /home/ev/peak-linux-driver-8.14.0/test/src/transmitest.cpp:340: undefined reference to `CAN_Status'
/usr/bin/ld: /home/ev/peak-linux-driver-8.14.0/test/src/transmitest.cpp:343: undefined reference to `CAN_VersionInfo'
/usr/bin/ld: /home/ev/peak-linux-driver-8.14.0/test/src/transmitest.cpp:355: undefined reference to `CAN_Init'
/usr/bin/ld: /home/ev/peak-linux-driver-8.14.0/test/src/transmitest.cpp:153: undefined reference to `parser::~parser()'
/usr/bin/ld: /home/ev/peak-linux-driver-8.14.0/test/src/transmitest.cpp:153: undefined reference to `parser::~parser()'
collect2: error: ld returned 1 exit status
make: *** [<builtin>: src/transmitest] Error 1
make: Leaving directory '/home/ev/peak-linux-driver-8.14.0/test'

Do you have idea why transmitest.cpp stop compling?


BR,
Magnus Zaza

M.Maidhof
Support
Support
Posts: 1751
Joined: Wed 22. Sep 2010, 14:00

Re: ld error while compling test code

Post by M.Maidhof » Wed 7. Sep 2022, 16:16

Hi,

please do a make clean first, or check the warnings displayed in line 3 and 4 of the make output.

As we don't know what, where and why you renamed the tools, simply start from the scratch and uninstall the driver 8.14, download the newer driver 8.15.1 and start again.

https://www.peak-system.com/fileadmin/m ... 5.1.tar.gz

regards

Michael

Magnus.Z
Posts: 7
Joined: Mon 2. May 2022, 11:24

Re: ld error while compling test code

Post by Magnus.Z » Thu 8. Sep 2022, 08:53

Hei, and thanks for the fast reply.

It is working now after a "make clean".




BR,
Magnus Zaza

Post Reply