rei-vilo/mpideXcode — Issue #1: Help needed: "multiple definition of `loop'" error message
Author: rei-vilo
Created: 2012-02-04 23:33:38+00:00
State: open

To get code-sense and code analysis working, Xcode requires a main.cpp file in the project folder.

So I added a main.cpp with only:

```
#include "Blink.pde"
int main(void)
{
init();
setup();
for (;;)
loop();
return 0;
}
```

Problem is, makefile is taking also the standard `main.cpp` from ```/Applications/Mpide.app/Contents/Resources/Java/hardware/arduino/cores/arduino/main.cpp``` and pops-up an error:

>
• Builds/main.o: In function 'loop':
/Users/OlS/Desktop/mpideXcode/mpideXcode/Blink.pde:34: multiple definition of 'loop'
Builds/Blink.o:/Users/OlS/Desktop/mpideXcode/mpideXcode/Builds/Blink.cpp:35: first defined here
• Builds/main.o: In function 'setup':
/Users/OlS/Desktop/mpideXcode/mpideXcode/Blink.pde:16: multiple definition of 'setup'
Builds/Blink.o:/Users/OlS/Desktop/mpideXcode/mpideXcode/Builds/Blink.cpp:17: first defined here
make: *** [Builds/Blink.elf] Error 1
>

How to modify the makefile to invoque only one `main.cpp` file and avoid duplicate definitions of setup and loop?

Thank you for your help.