User forums > General (but related to Code::Blocks)
Undefined reference to main - first arduino project in code::blocks
stahta01:
Found this value in "build options" "linker settings" "other linker options" for target "Arduino Mega 2560/ADK".
--- Code: ----mmcu=$(MCU)
--- End code ---
I suggest adding it to "Simulator - Debug" to see if it causes the error to happen on building "Simulator - Debug" target.
Edit: Likely better to add it like below.
--- Code: ----mmcu=atmega2560
--- End code ---
But, the first thing to change is to make the value of "ARDUINO_DIR" custom variable to be the same for both targets one of the has double quotes around it.
Tim S.
stahta01:
Make the compiler setting the same to verify one of those are not causing the difference.
Optimize generated code (for size)
Strip all symbols from binary (minimizes size)
Produce debugging symbols
I would suggest removing -mmcu=$(MCU) from Compiler other options for target "Arduino Mega 2560/ADK"
And instead add -mmcu=atmega2560 in Compiler other options for both targets
Tim S.
oBFusCATed:
As far as I know this is the most up to date arduino wizard: https://github.com/obfuscated/cb_arduino_template
But I don't know if the simulator targets work at all, I've never tried them.
To debug you problems you can run the arduino ide and see what commands and options are executed.
Then you can try to replicate them in C::B.
Navigation
[0] Message Index
[*] Previous page
Go to full version