undefined reference to `CAN_LookUpChanel'
Posted: Mon 18. Mar 2024, 12:11
Hi,
I am using Windows 10 and the TDM-GCC compiler to compile the code. Recently, I attempted to use the PCANBasic API in C++ and encountered several errors. The drivers are correctly installed and updated, and I'm trying to compile using `g++ main.cpp -o main.o`, but I'm receiving the following error:
```
C:/TDM-GCC-64/bin/../lib/gcc/x86_64-w64-mingw32/10.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\Users\aniol\AppData\Local\Temp\1\cc7Q9LYj.o:main.cpp:(.text+0x63): undefined reference to `CAN_LookUpChannel'
C:/TDM-GCC-64/bin/../lib/gcc/x86_64-w64-mingw32/10.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\Users\aniol\AppData\Local\Temp\1\cc7Q9LYj.o:main.cpp:(.text+0x8b): undefined reference to `CAN_GetErrorText'
collect2.exe: error: ld returned 1 exit status.
```
I will attach the code to provide more information about the error. Interestingly, when I attempt to call the functions from the PCANBasic header, the Visual Studio Code interface recognizes them and shows me the proper information about the functions (this will be attached as well).
I am using Windows 10 and the TDM-GCC compiler to compile the code. Recently, I attempted to use the PCANBasic API in C++ and encountered several errors. The drivers are correctly installed and updated, and I'm trying to compile using `g++ main.cpp -o main.o`, but I'm receiving the following error:
```
C:/TDM-GCC-64/bin/../lib/gcc/x86_64-w64-mingw32/10.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\Users\aniol\AppData\Local\Temp\1\cc7Q9LYj.o:main.cpp:(.text+0x63): undefined reference to `CAN_LookUpChannel'
C:/TDM-GCC-64/bin/../lib/gcc/x86_64-w64-mingw32/10.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\Users\aniol\AppData\Local\Temp\1\cc7Q9LYj.o:main.cpp:(.text+0x8b): undefined reference to `CAN_GetErrorText'
collect2.exe: error: ld returned 1 exit status.
```
I will attach the code to provide more information about the error. Interestingly, when I attempt to call the functions from the PCANBasic header, the Visual Studio Code interface recognizes them and shows me the proper information about the functions (this will be attached as well).