4 Replies Latest reply on Nov 3, 2016 11:03 AM by propanu

    Symbol lookup error in sample project

    MustafaAldemir

      Hi,

       

      I compiled the sample Fire Alarm project in C++. How-To Intel® IoT Technology Code Samples: Fire alarm in C++ | Intel® Software

       

      When I try running the project, it copies the executable file to /tmp on Edison, but nothing happens. And, I get the following error when I try running it manually.

       

      root@MustafaEdison:~# /tmp/fire-alarm

      /tmp/fire-alarm: symbol lookup error: /tmp/fire-alarm: undefined symbol: _ZN3upm9GroveTempC1Ejf

       

      I have mraa and upm installed on Edison. But opkg does not find a package named libmraa0.

       

      root@MustafaEdison:~# opkg list_installed|grep mraa

      mraa - 1.2.3

      root@MustafaEdison:~# opkg list_installed|grep upm

      upm - 0.7.3

      root@MustafaEdison:~# ls -l /usr/lib/libupm-grove.so*

      lrwxrwxrwx 1 root root    17 Aug 25 20:44 /usr/lib/libupm-grove.so -> libupm-grove.so.0

      lrwxrwxrwx 1 root root    21 Aug 25 20:44 /usr/lib/libupm-grove.so.0 -> libupm-grove.so.0.7.3

      -rwxr-xr-x 1 root root 32090 Aug  5 00:29 /usr/lib/libupm-grove.so.0.7.3

       

      I upgraded the libraries in Intel System Studio. The latest online available versions are: MRAA v1.1.2 and UPM v0.7.2. Screenshot 2016-08-27 23.56.42.png

       

      How can I fix the problem?

        • 1. Re: Symbol lookup error in sample project
          Intel Corporation
          This message was posted on behalf of Intel Corporation

          Hello MustafaAldemir,

          Could you please show us a screenshot of the error message? Also, could you please try to compile the code directly on your board? Do you notice any difference?

          -Peter.

          • 2. Re: Symbol lookup error in sample project
            Intel Corporation
            This message was posted on behalf of Intel Corporation

            Hello MustafaAldemir,

            Do you have any updates about this?

            -Peter.

            • 3. Re: Symbol lookup error in sample project
              jabez

              i meet it too,

               

              the code :

              /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

              #include "mraa.hpp"

              #include "grove.hpp"

              #include "jhd1313m1.h"

              //#include "limits.h"

               

               

              #include <climits>

              #include <iostream>

              #include <sstream>

              #include <unistd.h>

               

               

               

               

              /*

              * Grove Starter Kit example

              *

              * Demonstrate the usage of various component types using the UPM library.

              *

              * - digital in: GroveButton connected to the Grove Base Shield Port D4

              * - digital out: GroveLed connected to the Grove Base Shield Port D3

              * - analog in: GroveTemp connected to the Grove Base Shield Port A0

              * - I2C: Jhd1313m1 LCD connected to any I2C on the Grove Base Shield

              *

              * Additional linker flags: -lupm-i2clcd -lupm-grove

              */

               

               

              /*

              * Update the temperature values and reflect the changes on the LCD

              * - change LCD backlight color based on the measured temperature,

              *   a cooler color for low temperatures, a warmer one for high temperatures

              * - display current temperature

              * - record and display MIN and MAX temperatures

              * - reset MIN and MAX values if the button is being pushed

              * - blink the led to show the temperature was measured and data updated

              */

              void temperature_update(upm::GroveTemp* temperature_sensor, upm::GroveButton* button,

                upm::GroveLed* led, upm::Jhd1313m1 *lcd)

              {

                // minimum and maximum temperatures registered, the initial values will be

                // replaced after the first read

                static int min_temperature = INT_MAX;

                static int max_temperature = INT_MIN;

               

               

                // the temperature range in degrees Celsius,

                // adapt to your room temperature for a nicer effect!

                const int TEMPERATURE_RANGE_MIN_VAL = 18;

                const int TEMPERATURE_RANGE_MAX_VAL = 31;

               

               

                // other helper variables

                int temperature; // temperature sensor value in degrees Celsius

                float fade; // fade value [0.0 .. 1.0]

                uint8_t r, g, b; // resulting LCD backlight color components [0 .. 255]

                std::stringstream row_1, row_2; // LCD rows

               

               

                // update the min and max temperature values, reset them if the button is

                // being pushed

                temperature = temperature_sensor->value();

                if (button->value() == 1) {

                min_temperature = temperature;

                max_temperature = temperature;

                } else {

                if (temperature < min_temperature) {

                min_temperature = temperature;

                }

                if (temperature > max_temperature) {

                max_temperature = temperature;

                }

                }

               

               

                // display the temperature values on the LCD

                row_1 << "Temp " << temperature << "    ";

                row_2 << "Min " << min_temperature << " Max " << max_temperature << "    ";

                lcd->setCursor(0,0);

                lcd->write(row_1.str());

                lcd->setCursor(1,0);

                lcd->write(row_2.str());

               

               

                // set the fade value depending on where we are in the temperature range

                if (temperature <= TEMPERATURE_RANGE_MIN_VAL) {

                fade = 0.0;

                } else if (temperature >= TEMPERATURE_RANGE_MAX_VAL) {

                fade = 1.0;

                } else {

                fade = (float)(temperature - TEMPERATURE_RANGE_MIN_VAL) /

                (TEMPERATURE_RANGE_MAX_VAL - TEMPERATURE_RANGE_MIN_VAL);

                }

               

               

                // fade the color components separately

                r = (int)(255 * fade);

                g = (int)(64 * fade);

                b = (int)(255 * (1 - fade));

               

               

                // blink the led for 50 ms to show the temperature was actually sampled

                led->on();

                usleep(50000);

                led->off();

               

               

                // apply the calculated result

                lcd->setColor(r, g, b);

              }

               

               

              int main()

              {

                // check that we are running on Galileo or Edison

                mraa::Platform platform = mraa::getPlatformType();

                if ((platform != mraa::INTEL_GALILEO_GEN1) &&

                (platform != mraa::INTEL_GALILEO_GEN2) &&

                (platform != mraa::INTEL_EDISON_FAB_C)) {

                std::cerr << "Unsupported platform, exiting" << std::endl;

                return mraa::ERROR_INVALID_PLATFORM;

                }

               

               

                // button connected to D4 (digital in)

                upm::GroveButton* button = new upm::GroveButton(4);

               

               

                // led connected to D3 (digital out)

                upm::GroveLed* led = new upm::GroveLed(3);

               

               

                // temperature sensor connected to A0 (analog in)

                upm::GroveTemp* temp_sensor = new upm::GroveTemp(0);

               

               

                // LCD connected to the default I2C bus

                upm::Jhd1313m1* lcd = new upm::Jhd1313m1(0);

               

               

                // simple error checking

                if ((button == NULL) || (led == NULL) || (temp_sensor == NULL) || (lcd == NULL)) {

                std::cerr << "Can't create all objects, exiting" << std::endl;

                return mraa::ERROR_UNSPECIFIED;

                }

               

               

                // loop forever updating the temperature values every second

                for (;;) {

                temperature_update(temp_sensor, button, led, lcd);

                sleep(1);

                }

               

               

                return mraa::SUCCESS;

              }

               

               

              /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

               

              the CIW:

              16:53:30 **** Incremental Build of configuration Debug for project temp2lcd ****

              Info: Internal Builder is used for build

              i586-poky-linux-g++ "-IE:\\BaiduYunDownload\\edison_all\\edison_all\\IDE\\Intel_System_Studio_Eclipse_based\\Windows\\iss-iot-win_03-14-16\\iss-iot-win\\devkit-x86\\sysroots\\i586-poky-linux/usr/include/upm" "-IE:\\BaiduYunDownload\\edison_all\\edison_all\\IDE\\Intel_System_Studio_Eclipse_based\\Windows\\iss-iot-win_03-14-16\\iss-iot-win\\devkit-x86\\sysroots\\i586-poky-linux/usr/include/mraa" -O0 -g3 -Wall -c -fmessage-length=0 "--sysroot=E:\\BaiduYunDownload\\edison_all\\edison_all\\IDE\\Intel_System_Studio_Eclipse_based\\Windows\\iss-iot-win_03-14-16\\iss-iot-win\\devkit-x86\\sysroots\\i586-poky-linux" -m32 -march=i586 -c -ffunction-sections -fdata-sections -o "src\\temp2lcd.o" "..\\src\\temp2lcd.cpp"

              i586-poky-linux-g++ "--sysroot=E:\\BaiduYunDownload\\edison_all\\edison_all\\IDE\\Intel_System_Studio_Eclipse_based\\Windows\\iss-iot-win_03-14-16\\iss-iot-win\\devkit-x86\\sysroots\\i586-poky-linux" -lmraa -o temp2lcd "src\\temp2lcd.o" -lupm-i2clcd -lupm-grove

               

               

              16:53:38 Build Finished (took 7s.655ms)

               

              //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

              the error:

              root@edison:/tmp# ./temp2lcd

              ./temp2lcd: symbol lookup error: ./temp2lcd: undefined symbol: _ZN3upm9GroveTempC1Ejf

              • 4. Re: Symbol lookup error in sample project
                propanu

                Hi, the sensor libraries on your board are out of sync with the IDE. See Symbol lookup error for GroveTemp in C++ · Issue #470 · intel-iot-devkit/upm · GitHub for a solution to this.