Go Down

Topic: Undefined Reference to 'pinMode' (Read 4157 times) previous topic - next topic

engine_develop

Jan 27, 2015, 04:01 am Last Edit: Jan 27, 2015, 08:10 am by engine_develop
Hi,

I'm attempting to configure Qt Creator to work with the Arduino library and have run into an issue with undefined references. I've compiled the core library statically as 'libArduinoCore.a' (on Windows here), however when inspecting the AR file I can see the 'wiring_digital.o' object is omitted. Given that this object contains the implementations for 'pinMode' I believe the core library to be the culprit.

Has anyone run into similar issues when using other IDEs (eg. Eclipse)? Thanks for any information.

Kind regards,
Mark Davies

Ps: I should mention that I'm working with the RedBoard, an UNO clone (atmega328p).

engine_develop

#1
Jan 27, 2015, 08:13 am Last Edit: Jan 27, 2015, 09:59 am by Coding Badly
...just a quick note: the following snapshot shows the contents of the static library:

(link removed by moderator)

There are no 'wiring_*' objects included. This was taken from the 'core.a' file compiled from the IDE, using the Blink example sketch. Thanks for any insight.

Mark

Coding Badly

#2
Jan 27, 2015, 09:59 am Last Edit: Jan 27, 2015, 09:59 am by Coding Badly

Find another place to host the image.  I suggest you...

- Click Reply
- Click Attachments and other options
- Click Browse
- Locate and select the image
- Click OK
- Click Post


engine_develop

Attached.

bobcousins

Interesting idea to use 7zip to look at core.a, but it is the wrong sort of archive for 7zip I think. Surprised it works at all.

Anyway, the better way to look at .a files is with the command line tool "nm". This tool is in the Arduino package, in C:\Programs\arduino-1.0.5-r2\hardware\tools\avr\avr\bin in my case.

Run it with "nm <path to file>\core.a"

Please ask questions in the forum so everyone can benefit. PM me for paid work.

engine_develop

Yes, I've used 'nm' on Linux before, but have not installed Cygwin on my Windows machine yet. I'll give that a try.

In the meantime, I've set up my QT Creator environment to build the core for each sketch. I believe this is the way the Arduino IDE works, and saves the headache of maintaining separate library builds per API version/board pairing.

For those who are interested in using Arduino with Qt Creator, the project wizard lives here:

https://bitbucket.org/engine_develop/arduino_wizard

Mark

Go Up