Error! Cannot load library pcanbasic

  • Hello,
    I am trying to communicate with CAN interface via peakcan hardware, this is the link that I follow
    Program is run without errors if I dont use peakcan interface in the code

    The error is : Cannot load library pcanbasic: (pcanbasic: cannot open shared object file: No such file or directory)

    Hardware is connected successfully, when I "dmesg" on the console it outputs

    91929.495137] peak_usb 1-11:1.0: PEAK-System PCAN-USB adapter hwrev 28 serial FFFFFFFF (1 channel)
    [91929.495564] peak_usb 1-11:1.0 can0: attached to PCAN-USB channel 0 (device 20)

    this is my sample code, and this line couldn't run also, error occurs here.

    QCanBusDevice *device = QCanBus::instance()->createDevice(
        QStringLiteral("peakcan"), QStringLiteral("can0"));

    and also if I try to run my application it outputs to the kernel an error, which is shown when I type 'dmesg'

    segfault at 8 ip 00007f1fe3409049 sp 00007ffebd9e07b0 error 4 in[7f1fe33fc000+40000]

    Before that I connected a real BMS' can line, it worked well, but now I am trying to make CAN Simulator via using PeakCan, and this is where I found myself.

    Thanks for help people.

  • Qt Champions 2018

    Hi @xmastree, welcome!

    Cannot load library pcanbasic: (pcanbasic: cannot open shared object file: No such file or directory)

    The error is very obvious, it cannot load the shared library - therefore your program crashes.

    So please tell us:

    • where the library resides?
    • what file outputs?
    • Which Qt version you are using?


  • Hello

    I am using Qt 5.10

    and outputs I will provide 1-2 hours later, I am so sorry about that, little far away from computer,

    Any suggestion after outputting


    Thanks alot.

  • Hi,

    Seems, you can try a generic SocketCAN plugin (as I assume, you work on Linux) too. I'm think, the Linux kernel already contains an appropriate PCAN drivers.

  • Hello

    Yes ı am working on linux, but the problem is, I have peak hardware, so I should use it, and also in Qt there is peak interface, So how can I use it, or how can I add the pcanbasic library, how to make it work ?

    Thanks for helps

  • Qt Champions 2018


    On Linux you can indeed use SocketCAN, please see

    Peak hardware has a good support here, if your Linux Kernel is recent enough and has the Peak SocketCAN driver included.

    If you like to use the Peak proprietary driver and library, you have to compile the Peak driver and PCAN-Basic library yourself:


  • Hello

    Can I use SocketCAN to send and receive can messages from connected PEAK Hardware.
    I mean it could be possible, because connected PEAK Hardware also using can0...
    What is your opinion ?

  • Hello people,

    I found the solution, whether or not using PEAK hardware does not matter, SocketCAN is a general purpose Can driver, so if your CAN hardware connected at can0, usb1, usb2 etc. you dont need to use peakcan interface because of your hardware is PEAKCAN, you could connect it via socketcan.

Log in to reply

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.