Skip to content

Undefined Reference Error #2

@bmartin598

Description

@bmartin598

Previously I was able to compile the .cpp on my Raspberry Pi with no issues. Now I am having several. The g++ compiler throws an error saying <include/lidarlite_v3.h> can not be found. To fix this problem i added lidarlite_v3.h to the default linux include file and changed the code to #include <lidarlite_v3.h>. This seems to fix the error of not finding the file but then the compiler throws the following:

    /usr/bin/ld: /tmp/ccnZe3GD.o: in function `main':
    llv3.cpp:(.text+0x10): undefined reference to `LIDARLite_v3::i2c_init()'
    /usr/bin/ld: llv3.cpp:(.text+0x20): undefined reference to `LIDARLite_v3::configure(unsigned char, unsigned char)'
    /usr/bin/ld: llv3.cpp:(.text+0x2c): undefined reference to `LIDARLite_v3::getBusyFlag(unsigned char)'
    /usr/bin/ld: llv3.cpp:(.text+0x4c): undefined reference to `LIDARLite_v3::takeRange(unsigned char)'
    /usr/bin/ld: llv3.cpp:(.text+0x58): undefined reference to `LIDARLite_v3::readDistance(unsigned char)'
    collect2: error: ld returned 1 exit status

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions