Author Topic: CB and Arduino 1.6.x  (Read 48716 times)

Offline AZ

  • Almost regular
  • **
  • Posts: 151
CB and Arduino 1.6.x
« on: June 17, 2016, 08:44:09 pm »
Based on the conversation http://forums.codeblocks.org/index.php/topic,21049.new.html and http://forums.codeblocks.org/index.php/topic,21246.0.html, it is my understanding that CB's project wizard for Arduino is not functioning properly for 1.6.x.
The objective of this conversation is to, hopefully, get the CB to compile the 1.6.X code and maybe get Odfusicated's template https://github.com/obfuscated/cb_arduino_template to support 1.6 and replace(?) the existing project wizard plugin.
« Last Edit: June 17, 2016, 08:46:48 pm by AZ »
CB: nightly build .
Thread model: posix
gcc version 5.1.1 20150618 (Red Hat 5.1.1-4) (GCC)

Offline AZ

  • Almost regular
  • **
  • Posts: 151
Re: CB and Arduino 1.6.x
« Reply #1 on: June 17, 2016, 09:24:26 pm »
Steps to reproduce:
install the arduino 1.6.5 from their site.
Mine is @ :
/home/az/bin/arduino-1.6.5-r5/
avr-g++ installed a custom (not system ) location: /home/az/bin/arduino-1.6.5-r5/hardware/tools/avr/


a. Create an Arduino project using "Arduino project wizard"
b. Replace  provided sketch.cpp with the code below.
c. remove libraries.cpp file from the project.
d. you should now have only one file in your project. under "Src" directory.
Code
/*
  Turns on an LED on for one second, then off for one second, repeatedly.

  This example code is in the public domain.
*/

void setup()
{
Serial.begin(9600);

// initialize the digital pin as an output.
// Pin 13 has an LED connected on most Arduino boards:
pinMode(13, OUTPUT);
}

void loop()
{
Serial.println("Hello world!");

digitalWrite(13, HIGH);   // set the LED on
delay(1000);              // wait for a second
digitalWrite(13, LOW);    // set the LED off
delay(1000);              // wait for a second
}




Compiler setup:
 a. Settings->Compiler-> GCC for AVR. Updated "Search directories"-> Compiler to have "/home/az/bin/arduino-1.6.5-r5/hardware/tools/" ; "Linker"-> /home/az/bin/arduino-1.6.5-r5/hardware/tools/avr ; "Toolchain" -> /home/az/bin/arduino-1.6.5-r5/hardware/tools/avr
everything else is set to default. There are no additional variables set.

Template usage:
// Yes, i first generated the project only after that git the template.

 a. git the "https://github.com/obfuscated/cb_arduino_template"
 b. in /home/az/.config/codeblocks :
     arduino -> /home/az/bin/arduino-1.6.5-r5/
     cb_arduino_template-master -> /home/az/.config/codeblocks/cb_arduino_template-master

c. The project specific changes:
 Wizard's generated project file has been modified to add "avr" subdir and i removed the APP_DIR reference and hardcoded the direct path to the arduino installation (for now):
Code
<Target title="Arduino Uno">
<Option output="bin/Release/test_3.elf" prefix_auto="1" extension_auto="0" />
<Option type="1" />
<Option compiler="avr-gcc" />
<Compiler>
<Add option="-Os" />
<Add option="-mmcu=$(MCU)" />
<Add option="-D__AVR_ATmega328P__" />
<Add directory="$(ARDUINO_DIR)/hardware/arduino/cores/arduino" />
<Add directory="$(ARDUINO_DIR)/libraries" />
<Add directory="$(ARDUINO_DIR)/hardware/arduino/variants/standard" />
</Compiler>
<Linker>
<Add option="-s" />
<Add option="-mmcu=$(MCU)" />
</Linker>
<ExtraCommands>
<Add after="avr-objcopy -O ihex -R .eeprom -R .eesafe $(TARGET_OUTPUT_FILE) $(TARGET_OUTPUT_FILE).hex" />
<Add after="avr-objcopy --no-change-warnings -j .eeprom --change-section-lma .eeprom=0 -O ihex $(TARGET_OUTPUT_FILE) $(TARGET_OU
TPUT_FILE).eep.hex" />
<Add after="avr-size $(TARGET_OUTPUT_FILE)" />
</ExtraCommands>
<Environment>
<Variable name="ARDUINO_DIR" value="/home/az/bin/arduino-1.6.5-r5" />
<Variable name="BOARD" value="Arduino Uno" />
<Variable name="BOARD_INDEX" value="1" />
<Variable name="MCU" value="atmega328p" />
<Variable name="UPLOAD_BAUDRATE" value="115200" />
<Variable name="UPLOAD_PORT" value="" />
</Environment>
</Target>


Now the compilation logs:
Code

-------------- Build file: Arduino Uno in test_3 (compiler: GNU GCC Compiler for AVR)---------------

avr-g++ -Wall -fno-exceptions -ffunction-sections -fdata-sections -x c++ -s -DF_CPU=16000000L -DARDUINO=103 -DUSE_EEPROM=0 -DUSE_ETHERNET=0 -DUSE_FIRMATA=0 -DUSE_LCD=0 -DUSE_LCD4884=0 -DUSE_OBD=0 -DUSE_SD=0 -DUSE_SERVO=0 -DUSE_SOFTSERIAL=0 -DUSE_SPI=0 -DUSE_STEPPER=0 -DUSE_TINYGPS=0 -DUSE_WIRE=0 -Os -mmcu=atmega328p -D__AVR_ATmega328P__ -I/home/az/bin/arduino-1.6.5-r5/hardware/arduino/avr/cores/arduino -I/home/az/bin/arduino-1.6.5-r5/libraries -I/home/az/bin/arduino-1.6.5-r5/hardware/arduino/avr/variants/standard -I/home/az/bin/arduino-1.6.5-r5/hardware/tools/ -c sketch.cpp -o .objs/sketch.o
sketch.cpp: In function 'void setup()':
sketch.cpp:11:2: error: 'Serial' was not declared in this scope
  Serial.begin(9600);
  ^
sketch.cpp:15:14: error: 'OUTPUT' was not declared in this scope
  pinMode(13, OUTPUT);
              ^
sketch.cpp:15:20: error: 'pinMode' was not declared in this scope
  pinMode(13, OUTPUT);
                    ^
sketch.cpp: In function 'void loop()':
sketch.cpp:20:2: error: 'Serial' was not declared in this scope
  Serial.println("Hello world!");
  ^
sketch.cpp:22:19: error: 'HIGH' was not declared in this scope
  digitalWrite(13, HIGH);   // set the LED on
                   ^
sketch.cpp:22:23: error: 'digitalWrite' was not declared in this scope
  digitalWrite(13, HIGH);   // set the LED on
                       ^
sketch.cpp:23:12: error: 'delay' was not declared in this scope
  delay(1000);              // wait for a second
            ^
sketch.cpp:24:19: error: 'LOW' was not declared in this scope
  digitalWrite(13, LOW);    // set the LED off
                   ^
Process terminated with status 1 (0 minute(s), 0 second(s))
8 error(s), 0 warning(s) (0 minute(s), 0 second(s))


That is the progress for now.

As far as the template goes.
So if i right click on the "arduino project" in the wizard i get the message below.
The "ls -l ~/.local/share/codeblocks/templates/wizard/arduino/" is empty.
« Last Edit: June 17, 2016, 11:01:21 pm by AZ »
CB: nightly build .
Thread model: posix
gcc version 5.1.1 20150618 (Red Hat 5.1.1-4) (GCC)

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7582
    • My Best Post
Re: CB and Arduino 1.6.x
« Reply #2 on: June 17, 2016, 10:19:16 pm »
Post the full rebuild log in this thread.

Edit: http://wiki.codeblocks.org/index.php/FAQ-Compiling_%28errors%29#Q:_How_do_I_troubleshoot_a_compiler_problem.3F

IMHO: The first step is getting an CB Project to compile using the sample code you posted or other good sample code.

Then compare the two wizards generated projects to the working project.

Tim S.
« Last Edit: June 17, 2016, 10:21:34 pm by stahta01 »
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline AZ

  • Almost regular
  • **
  • Posts: 151
Re: CB and Arduino 1.6.x
« Reply #3 on: June 17, 2016, 10:32:05 pm »
Post the full rebuild log in this thread.

Edit: http://wiki.codeblocks.org/index.php/FAQ-Compiling_%28errors%29#Q:_How_do_I_troubleshoot_a_compiler_problem.3F

IMHO: The first step is getting an CB Project to compile using the sample code you posted or other good sample code.

Then compare the two wizards generated projects to the working project.

Tim S.

Thank you Tim. Got interrupted when was posting. Updated now. Please let me know if i need to add anything else.
CB: nightly build .
Thread model: posix
gcc version 5.1.1 20150618 (Red Hat 5.1.1-4) (GCC)

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7582
    • My Best Post
Re: CB and Arduino 1.6.x
« Reply #4 on: June 18, 2016, 03:28:51 am »
I still NEED the FULL rebuild log!

A partial log is NOT enough for me to see possible issues.

And, where did the code you posted come from; it does NOT look like good C code to me.

Tim S.
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline AZ

  • Almost regular
  • **
  • Posts: 151
Re: CB and Arduino 1.6.x
« Reply #5 on: June 18, 2016, 04:16:50 am »
I still NEED the FULL rebuild log!

A partial log is NOT enough for me to see possible issues.

And, where did the code you posted come from; it does NOT look like good C code to me.

Tim S.

it is NOT a good C/C++ code. It is a sketch file. As i'm learning here (https://www.arduino.cc/en/Hacking/BuildProcess).  Arduino converts the sketch file to proper c/cpp and only after that calls the g++ compiler.

Let me work on the _proper_ cpp file.


> I still NEED the FULL rebuild log!
I'm not sure where/what you need... I uploaded all information from the "build log" window.
CB: nightly build .
Thread model: posix
gcc version 5.1.1 20150618 (Red Hat 5.1.1-4) (GCC)

Offline AZ

  • Almost regular
  • **
  • Posts: 151
Re: CB and Arduino 1.6.x
« Reply #6 on: June 18, 2016, 06:39:48 am »
So i took step back and tried to compile the files by hand ( without CB).
Here is what i learned.
The ino file (in it's simplified form) is converted to a cpp with 3 lines:
Code
// save as Blink.cpp

#include "Arduino.h"
void setup();
void loop();
/*
  Blink
  Turns on an LED on for one second, then off for one second, repeatedly.

  Most Arduinos have an on-board LED you can control. On the Uno and
  Leonardo, it is attached to digital pin 13. If you're unsure what
  pin the on-board LED is connected to on your Arduino model, check
  the documentation at http://www.arduino.cc

  This example code is in the public domain.

  modified 8 May 2014
  by Scott Fitzgerald
 */


// the setup function runs once when you press reset or power the board
void setup() {
  // initialize digital pin 13 as an output.
  pinMode(13, OUTPUT);
}

// the loop function runs over and over again forever
void loop() {
  digitalWrite(13, HIGH);   // turn the LED on (HIGH is the voltage level)
  delay(1000);              // wait for a second
  digitalWrite(13, LOW);    // turn the LED off by making the voltage LOW
  delay(1000);              // wait for a second
}

that can be compiled with :
Code
avr-g++ -c -g -Os -w -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -MMD -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10604 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR  -I. -I${CORE} Blink.cpp

where CORE - /home/az/bin/arduino-1.6.5-r5/hardware/arduino/avr/cores/arduino

Next step up was to understand how Arduino (IDE) compiles the sketches (ino files).

 It seems that it copies *.cpp and *.c file to a temp directory adds a "Blink.cpp" and compiles them one by one then it links them all into one file before uploading to a board.

The arduino-1.6.5-r5/hardware/arduino/avr/cores/arduino/main.cpp is the actual "main" file, that calls all the functions from "Blink":
Code
#include <Arduino.h>

// Declared weak in Arduino.h to allow user redefinitions.
int atexit(void (* /*func*/ )()) { return 0; }

// Weak empty variant initialization function.
// May be redefined by variant files.
void initVariant() __attribute__((weak));
void initVariant() { }

int main(void)
{
init();

initVariant();

#if defined(USBCON)
USBDevice.attach();
#endif

setup();
   
for (;;) {
loop();
if (serialEventRun) serialEventRun();
}
       
return 0;
}


Summary so far:
 a. arduino converts "ino" files to cpp by adding 3 lines to the top of the ino file.
 b. arduino copies all the c/cpp files into single temp location. One of these files is "main.cpp" that has calls to the functions in the Blink.cpp
 c. then arduino calls g++ to compile each of these files separately and links them into one file
 d. once completed, the file gets uploaded to the board.

So the cb project (probably) needs to make a copy of that main.cpp. and treat all "sketches" as libraries.
Next, since arduino copies all cpp/c files into one temp location and compiles and links them there, i would think, that either project wizard should do that or CB should use a build system.


P.S. cool. i just found the up-to-date ( and up to latest arduino version) build system - https://github.com/sudar/Arduino-Makefile
« Last Edit: June 18, 2016, 07:00:13 am by AZ »
CB: nightly build .
Thread model: posix
gcc version 5.1.1 20150618 (Red Hat 5.1.1-4) (GCC)

Offline AZ

  • Almost regular
  • **
  • Posts: 151
Re: CB and Arduino 1.6.x
« Reply #7 on: June 18, 2016, 07:04:28 am »
I suspect Tim will yell at me again for not posting the complete log...
But here the entire log from "build log":
Code

-------------- Clean: Arduino Uno in test_3 (compiler: GNU GCC Compiler for AVR)---------------

Cleaned "test_3 - Arduino Uno"

-------------- Build: Arduino Uno in test_3 (compiler: GNU GCC Compiler for AVR)---------------

avr-g++ -Wall -fno-exceptions -ffunction-sections -fdata-sections -x c++ -s -DF_CPU=16000000L -DARDUINO=103 -DUSE_EEPROM=0 -DUSE_ETHERNET=0 -DUSE_FIRMATA=0 -DUSE_LCD=0 -DUSE_LCD4884=0 -DUSE_OBD=0 -DUSE_SD=0 -DUSE_SERVO=0 -DUSE_SOFTSERIAL=0 -DUSE_SPI=0 -DUSE_STEPPER=0 -DUSE_TINYGPS=0 -DUSE_WIRE=0 -Os -mmcu=atmega328p -D__AVR_ATmega328P__ -I/home/az/bin/arduino-1.6.5-r5/hardware/arduino/avr/cores/arduino -I/home/az/bin/arduino-1.6.5-r5/libraries -I/home/az/bin/arduino-1.6.5-r5/hardware/arduino/avr/variants/standard -I/home/az/bin/arduino-1.6.5-r5/hardware/tools/ -c main.cpp -o .objs/main.o
avr-g++ -Wall -fno-exceptions -ffunction-sections -fdata-sections -x c++ -s -DF_CPU=16000000L -DARDUINO=103 -DUSE_EEPROM=0 -DUSE_ETHERNET=0 -DUSE_FIRMATA=0 -DUSE_LCD=0 -DUSE_LCD4884=0 -DUSE_OBD=0 -DUSE_SD=0 -DUSE_SERVO=0 -DUSE_SOFTSERIAL=0 -DUSE_SPI=0 -DUSE_STEPPER=0 -DUSE_TINYGPS=0 -DUSE_WIRE=0 -Os -mmcu=atmega328p -D__AVR_ATmega328P__ -I/home/az/bin/arduino-1.6.5-r5/hardware/arduino/avr/cores/arduino -I/home/az/bin/arduino-1.6.5-r5/libraries -I/home/az/bin/arduino-1.6.5-r5/hardware/arduino/avr/variants/standard -I/home/az/bin/arduino-1.6.5-r5/hardware/tools/ -c sketch.cpp -o .objs/sketch.o
avr-g++ -L/home/az/bin/arduino-1.6.5-r5/hardware/tools/avr -o bin/Release/test_3.elf .objs/main.o .objs/sketch.o  -Wl,--gc-sections -s -mmcu=atmega328p 
.objs/main.o: In function `main':
main.cpp:(.text.startup.main+0x0): undefined reference to `init'
.objs/sketch.o: In function `setup':
sketch.cpp:(.text.setup+0xa): undefined reference to `Serial'
sketch.cpp:(.text.setup+0xc): undefined reference to `Serial'
sketch.cpp:(.text.setup+0xe): undefined reference to `HardwareSerial::begin(unsigned long, unsigned char)'
sketch.cpp:(.text.setup+0x16): undefined reference to `pinMode'
.objs/sketch.o: In function `loop':
sketch.cpp:(.text.loop+0x4): undefined reference to `Serial'
sketch.cpp:(.text.loop+0x6): undefined reference to `Serial'
sketch.cpp:(.text.loop+0x8): undefined reference to `Print::println(char const*)'
sketch.cpp:(.text.loop+0x10): undefined reference to `digitalWrite'
sketch.cpp:(.text.loop+0x1c): undefined reference to `delay'
sketch.cpp:(.text.loop+0x24): undefined reference to `digitalWrite'
sketch.cpp:(.text.loop+0x30): undefined reference to `delay'
collect2: error: ld returned 1 exit status
Process terminated with status 1 (0 minute(s), 0 second(s))
13 error(s), 0 warning(s) (0 minute(s), 0 second(s))
 

I have 3 files in the project - main.cpp, sketch.cpp and pins_arduino.h .
CB: nightly build .
Thread model: posix
gcc version 5.1.1 20150618 (Red Hat 5.1.1-4) (GCC)

Offline yvesdm3000

  • Almost regular
  • **
  • Posts: 225
Re: CB and Arduino 1.6.x
« Reply #8 on: June 18, 2016, 06:14:37 pm »
Your compiler is saying that it can't link some functions, normally this is because some libraries are not specified or missing.

Yves
Clang based code completion for Code::Blocks:   http://github.com/yvesdm3000/ClangLib

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: CB and Arduino 1.6.x
« Reply #9 on: June 18, 2016, 07:02:06 pm »
You need to build the files inside the Arduino that contain the code that is not defined.
In my wizard (probably in the original, too) this is done by adding files that are named the same as the on being compiled and their content is #include <Blabla.cpp>. Make sure you use <> instead of "".
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline AZ

  • Almost regular
  • **
  • Posts: 151
Re: CB and Arduino 1.6.x
« Reply #10 on: June 18, 2016, 07:23:15 pm »
Your compiler is saying that it can't link some functions, normally this is because some libraries are not specified or missing.

Yves

correct. I'm not at the stage where i can build the project yet.
Learning how to get all the o files together.
CB: nightly build .
Thread model: posix
gcc version 5.1.1 20150618 (Red Hat 5.1.1-4) (GCC)

Offline AZ

  • Almost regular
  • **
  • Posts: 151
Re: CB and Arduino 1.6.x
« Reply #11 on: June 18, 2016, 07:25:23 pm »
You need to build the files inside the Arduino that contain the code that is not defined.
In my wizard (probably in the original, too) this is done by adding files that are named the same as the on being compiled and their content is #include <Blabla.cpp>. Make sure you use <> instead of "".

Can you please elaborate a bit on what did you mean by "You need to build the files inside the Arduino that contain the code that is not defined."?

Did you mean this:
b. arduino copies all the c/cpp files into single temp location. One of these files is "main.cpp" that has calls to the functions in the Blink.cpp
 c. then arduino calls g++ to compile each of these files separately and links them into one file
 

Also, are you saying that your wizard parses the file and adds all "includes" prior to compilation?
« Last Edit: June 18, 2016, 07:29:52 pm by AZ »
CB: nightly build .
Thread model: posix
gcc version 5.1.1 20150618 (Red Hat 5.1.1-4) (GCC)

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7582
    • My Best Post
Re: CB and Arduino 1.6.x
« Reply #12 on: June 18, 2016, 08:04:22 pm »
I got the linked to Wizard to work. https://github.com/obfuscated/cb_arduino_template

Code
#include <Arduino.h>

/*
  Turns on an LED on for one second, then off for one second, repeatedly.
 
  This example code is in the public domain.
*/

void setup()
{
// initialize the digital pin as an output.
// Pin 13 has an LED connected on most Arduino boards:
pinMode(13, OUTPUT);     
}

void loop()
{
digitalWrite(13, HIGH);   // set the LED on
delay(1000);              // wait for a second
digitalWrite(13, LOW);    // set the LED off
delay(1000);              // wait for a second
}

My Full build log is too large to put in code tags ( total message was over 20,000 characters).

No idea of what fixes I did in the past; this is NOT the first time I tried to use this wizard; will try to post what I think is needed later today.

Edit: Attached log.

Tim S.
« Last Edit: June 18, 2016, 08:06:40 pm by stahta01 »
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7582
    • My Best Post
Re: CB and Arduino 1.6.x
« Reply #13 on: June 18, 2016, 09:15:48 pm »
I think I have the steps I used.

https://github.com/stahta01/cb_misc/blob/master/Notes/Arduino/CodeBlocks_Arduino_noSim_setup.txt

The steps in link above are in the Code Tags below; no idea where the idea for the steps came from; I did them in trial and error using info found on Internet.
Code
## Code::Blocks IDE should already be installed.
## But, the Code::Blocks IDE should NOT be running!

#  See if arduino wizard exists already.
ls  /usr/share/codeblocks/templates/wizard/arduino/

#  If not copy form the location it was downloaded.
cd ~ && pwd     # /home/stahta01
su              # Enter su mode
cp -p --recursive /home/stahta01/cb_arduino_template-master/ /usr/share/codeblocks/templates/wizard/arduino/
exit            # Exit su mode

# Start Code::Blocks IDE
# Check if the "Arduino Project" Wizard exists.

# If "Arduino Project" wizard missing, add the next line to the startup script.
RegisterWizard(wizProject,     _T("arduino"),      _T("Arduino Project"),       _T("Embedded Systems"));


## Run "Arduino Project" Wizard; I used "Arduino Uno" option to test.

# First error I get when building "Arduino Uno" Project.
fatal error: CDC.cpp: No such file or directory


mkdir -p ~/.codeblocks

cd ~/.codeblocks

ln -s ~/sketchbook sketches

pwd  # /home/stahta01/.codeblocks

su
ln -s /usr/share/arduino /home/stahta01/.codeblocks/arduino
exit  # su mode

Tim S.
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline AZ

  • Almost regular
  • **
  • Posts: 151
Re: CB and Arduino 1.6.x
« Reply #14 on: June 18, 2016, 10:29:47 pm »
I think I have the steps I used.

https://github.com/stahta01/cb_misc/blob/master/Notes/Arduino/CodeBlocks_Arduino_noSim_setup.txt

The steps in link above are in the Code Tags below; no idea where the idea for the steps came from; I did them in trial and error using info found on Internet.
Code
## Code::Blocks IDE should already be installed.
## But, the Code::Blocks IDE should NOT be running!

#  See if arduino wizard exists already.
ls  /usr/share/codeblocks/templates/wizard/arduino/

#  If not copy form the location it was downloaded.
cd ~ && pwd     # /home/stahta01
su              # Enter su mode
cp -p --recursive /home/stahta01/cb_arduino_template-master/ /usr/share/codeblocks/templates/wizard/arduino/
exit            # Exit su mode

# Start Code::Blocks IDE
# Check if the "Arduino Project" Wizard exists.

# If "Arduino Project" wizard missing, add the next line to the startup script.
RegisterWizard(wizProject,     _T("arduino"),      _T("Arduino Project"),       _T("Embedded Systems"));


## Run "Arduino Project" Wizard; I used "Arduino Uno" option to test.

# First error I get when building "Arduino Uno" Project.
fatal error: CDC.cpp: No such file or directory


mkdir -p ~/.codeblocks

cd ~/.codeblocks

ln -s ~/sketchbook sketches

pwd  # /home/stahta01/.codeblocks

su
ln -s /usr/share/arduino /home/stahta01/.codeblocks/arduino
exit  # su mode

Tim S.

Tim, does this run on Arduino 1.5+ ? 
looks pretty cool.
CB: nightly build .
Thread model: posix
gcc version 5.1.1 20150618 (Red Hat 5.1.1-4) (GCC)