Author Topic: [SOLVED]"CodeBlocks gives gcc wrong search directories"  (Read 4358 times)

Offline thoughtcrime

  • Single posting newcomer
  • *
  • Posts: 8
[SOLVED]"CodeBlocks gives gcc wrong search directories"
« on: March 01, 2009, 01:23:25 pm »
Hi. I am trying to help a friend who intended to put this post here, but his new account he just registered seems to need validation by administration before he can do that.
Hey everyone.
I use Codeblocks 8.02-7 in Arch Linux ( 64 bit ).
Everything worked fine a month ago, but now it seems that CodeBlocks gives gcc / g++ wrong parameters.
I can't even compile a simple C HelloWorld-Program, because gcc / g++ can't find <iostream> or <cstdlib>. However, <stdlib.c> is found, but this requires <stddef.h> which can't be found.
I thought my toolchain was broken or so, but if I go ahead and compile it in a console with "gcc main.c -o helloworld", everything works fine.
Does anyone know what I can do about this issue?
I already tried to reinstall CodeBlocks and to remove the config directory "~/.codeblocks".

His nickname is ADI64, it would be nice if someone could help him :)
I'll send him the URL of this topic and he'll keep watching it.
« Last Edit: March 01, 2009, 01:57:12 pm by thoughtcrime »

Offline jens

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: "CodeBlocks gives gcc wrong search directories"
« Reply #1 on: March 01, 2009, 01:32:42 pm »
Change "Settings -> Compiler and debugger... -> Global compiler settings -> [the compiler you use] -> Other settings(rightmost tab)" "Compiler logging" to "Full commandline" and post the content of the build log.

Make sure the global compiler settings (see above) for search and link dir's are empty (unless you know exactly what you do), and make sure the toolchain is setup correctly and pointing to the correct directories/executables. The master path ("Compiler's installation directory") is prepended to the system path, so two versions of gcc can mess up C::B and it is possible that the commandline works, but not the version used in toolchain (if it is not set up correctly).

Offline thoughtcrime

  • Single posting newcomer
  • *
  • Posts: 8
Re: "CodeBlocks gives gcc wrong search directories"
« Reply #2 on: March 01, 2009, 01:56:59 pm »
Thanks for answering. We have found the error now as I suggested starting from terminal (to change the compiler's output language to english). He used "launchy" before to start it - and whenever he starts codeblocks with launchy it does not work while it works per terminal or gnome menu (strange o0).