Pages

January 16, 2012

Fixing CodeBlocks AVR build problems on Debian Wheezy

This might be a bit off-topic, but I didn't know where else to put this.

I spent a good part of this evening trying to figure out why I could build AVR projects in CodeBlocks using an old profile (i.e., personality) but not a new one. When I tried to compile with a new one (even on a different machine), the compile would generate a

/usr/include/features.h:323:26: fatal error: bits/predefs.h: No such file or directory

error.

By comparing the old and newly created profiles, I was able to figure out that new profiles were setting default include directories for building indiscriminately versus not at all for the old profile. The following seems to fix things, but to be honest I have not tested a wide variety of AVR builds nor have I tested any other kinds of projects. But I can't see why it should mess anything else up.
  1. Open Settings > Compiler and debugger... > Global compiler settings
  2. Under Selected compiler, select "GNU AVR GCC Compiler"
  3. Select the "Search directories" tab
  4. Select the "Compiler" tab
  5. Select the /usr/include entry and click the "Delete" button
  6. Right next to the "Compiler" tab, select the "Linker" tab
  7. Select the /usr/lib entry and click the "Delete" button
AVR builds should now succeed. This fix should work with additional profiles you add as well as to the default.conf profile.

4 comments:

vvy said...

Much Helpful and Clear

Victor said...

Thanks a lot! Just upgraded to Code::Blocks 12.11 and encountered this issue.

Unknown said...

Thanks a lot! Works fine with Code::Blocks 10.05

Unknown said...

Works fine with Code::Blocks 10.05 under Ubuntu 12.04