11 years, 4 months ago.

Why errors when attepting to create a new program with (previously working) existing libraries?

Hello Everyone!

I am very new to the software side of electronics and am hoping that someone can help me out with this issue. I have an mbed, a small monochrome OLED display, and an SHT21 temp/humidity sensor. My objective for the day was to create a thermometer using these components.

I have gotten the display working using Neal Hormans port of the Adafruit GFX library (http://mbed.org/users/nkhorman/code/Adafruit_GFX/). This has worked well so far, although I have not gotten into drawing graphics yet (Thanks, Neal!). The SHT21 sensor was easy to get working on its own, using the library in the cookbook (http://mbed.org/cookbook/SHT21).

The issue occurs when I create a new program, and include both of these libraries. To accomplish this, I right-click on each of the library folders in the compiler and select "Export Folder..." and save them locally. After I create a new program in the compiler, I right-click and select "Import Library..." and select the zip files for each library. The new code that combines the screen and the sensor is created within main.cpp, and I have no errors here when I attempt to compile. The compiler does give a number of errors, but they all suggest issues with the libraries. Error 289 is the most common, but here is a screen shot of the compiler output:

/media/uploads/wanispissd/mbed_compiler_-_mozilla_firefox_2012-12-26_19-51-04.jpg

In an attempt to isolate the issue, imported the example libraries into new programs, and then copy-paste in the contents of the examples main.cpp into the new main.cpp (essentially duplicate the example program). When I compile these I get a smaller sub-set of the errors above (one set for the OLED duplicate and another set for the SHT21 duplicate).

Why do programs not seem to work when the libraries have been imported? How can I fix them?

I believe the answer must be simple, but I just cannot seen to find anything.

Thanks!

Question relating to:

1 Answer

11 years, 4 months ago.

Seems like the Class references are different for each type, within the mbed tree:

Example (works):

/media/uploads/wanispissd/mbed_compiler_-_mozilla_firefox_2012-12-26_20-15-34.jpg

Duplicate (compile errors):

/media/uploads/wanispissd/mbed_compiler_-_mozilla_firefox_2012-12-26_20-17-17.jpg

Next I will attempt to modify my libraries to remove these name references.

Accepted Answer