queezythegreat/arduino-cmake — Issue #11: undefined reference to 'loop'
Author: treaves
Created: 2012-01-06 14:45:24+00:00
State: open

I have a very simple project located https://code.launchpad.net/~treaves/+junk/blinkqp . The compile fails with the message in the title. This project is just a junk project to figure out how to get the qp library linked in to a project.

The loop function is defined: http://bazaar.launchpad.net/~treaves/+junk/blinkqp/view/head:/libraries/qp/qp_port.cpp#L33 . I can see from the verbose make output that the correct library seems to be in the linker command.

```
cd /home/treaves/Development/qp/blinkqp/builds/unix/src && /usr/bin/cmake -E cmake_link_script CMakeFiles/blink.dir/link.txt --verbose=1
/usr/bin/avr-g++ -g -Os -ffunction-sections -fdata-sections -fno-exceptions -Wl,--gc-sections -mmcu=atmega1284p CMakeFiles/blink.dir/project.cpp.obj CMakeFiles/blink.dir/blink.cpp.obj CMakeFiles/blink.dir/bsp.cpp.obj -o blink.elf libatmega1284_Wire.a ../libraries/libqp.a ../libraries/libatmega1284_CORE.a
../libraries/libatmega1284_CORE.a(main.cpp.obj): In function `main':
/usr/local/arduino/hardware/arduino/cores/sanguino/main.cpp:10: undefined reference to `loop'
```

I see ../libraries/libqp.a there, so I'm not sure why the error. Any ideas?