- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The iotdk-ide-win SDK(Eclipse) works great on my Windows machine to compile, upload and run programs on my Edison. And of course, I can run the compiled executable directly on the Edison from its command line, too.
But I am not able to compile C programs using mraa references directly on the Edison. I get this error:
/tmp/ccqxH6Mw.o: In function `main':
analog_input.c:(.text+0x18): undefined reference to `mraa_aio_init'
analog_input.c:(.text+0x28): undefined reference to `mraa_aio_read'
collect2: error: ld returned 1 exit status
I would have expected the compiler to error on the #include "mraa.h" line if that was the problem.
I can compile other C programs on the Edison using gcc.
Any help?
- Tags:
- Internet of Things
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
It is linker not compiler giving the error. Please make sure you add -lmraa to the options to let the linker know what library to link with.
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
It is linker not compiler giving the error. Please make sure you add -lmraa to the options to let the linker know what library to link with.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks Alexander. That was my problem. Here is an example for other rookies like me:
gcc -g analog_input.c -o analog_input -lmraa

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page