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

Symbol lookup error in sample project

Hi,

I compiled the sample Fire Alarm project in C++. https://software.intel.com/en-us/articles/how-to-intel-iot-code-samples-fire-alarm-in-cpp 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.

How can I fix the problem?

0 Kudos
4 Replies
Highlighted
Community Manager
8 Views

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.
0 Kudos
Highlighted
Community Manager
8 Views

Hello MustafaAldemir,

 

 

Do you have any updates about this?

 

 

-Peter.
0 Kudos
Highlighted
Beginner
8 Views

i meet it too,

the code :

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

# include "mraa.hpp"

# include "grove.hpp"

# include "jhd1313m1.h"

//# include "limits.h"

# include

# include

# include

# include

/*

* 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-i.../usr/include/upm" "-IE:\\BaiduYunDownload\\edison_all\\edison_all\\IDE\\Intel_System_Studio_Eclipse_based\\Windows\\iss-i.../usr/include/mraa" -O0 -g3 -Wall -c -fmessage-length=0 "--sysroot=E:\\BaiduYunDownload\\edison_all\\edison_all\\IDE\\Intel_System_Studio_Eclipse_based\\Wind...

0 Kudos
Highlighted
8 Views

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

0 Kudos