Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Novice
894 Views

symbol lookup error: ... undefined symbol: ...

Jump to solution

Hi all, I am trying to run this simple C++ code in Eclipse to test a HC-SR04 sensor on my Edison + Arduino Breakout:

# include "mraa.hpp"

# include "hcsr04.h"

# include

# include

# include

# include

# include

# include

upm::HCSR04 *sonar = NULL;

void

sig_handler(int signo)

{

printf("got signal\n");

if (signo == SIGINT) {

printf("exiting application\n");

sonar->m_doWork = 1;

}

}

void

interrupt (void * args) {

sonar->ackEdgeDetected ();

}

int main()

{

setvbuf(stdout, NULL, _IONBF, 0);

sonar = new upm::HCSR04(2, 3, &interrupt);

signal(SIGINT, sig_handler);

printf ("width = %d\n", sonar->getDistance());

delete sonar;

return 0;

}

The code compiles without problems, but when running on the board I get this error in the console:

/tmp/SensorTest: symbol lookup error: /tmp/SensorTest: undefined symbol: _ZN3upm6HCSR0411getDistanceEv

Could someone point what is the problem? Thanks.


Accepted Solutions
Highlighted
Novice
32 Views

Looks like I solved it by myself. It appears that I had different versions of the required libraries on the board and on Eclipse. Downloaded the matching version to the Eclipse repository and rebuilt the indexes, now everything seems to work fine.

View solution in original post

1 Reply
Highlighted
Novice
33 Views

Looks like I solved it by myself. It appears that I had different versions of the required libraries on the board and on Eclipse. Downloaded the matching version to the Eclipse repository and rebuilt the indexes, now everything seems to work fine.

View solution in original post