1 Reply Latest reply on Nov 22, 2015 9:55 AM by gnogna82

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

    gnogna82

      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 <iostream>
      #include <unistd.h>
      #include <iostream>
      #include <signal.h>
      #include <stdlib.h>
      #include <sys/time.h>
      
      
      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.