User forums > Using Code::Blocks
CB ignores search directories/Global variables
stahta01:
NOTE: The Compiler you are changing the options on; MUST be the Compiler you are using to compile your project!
To check the CB Compiler name being used to compile your project do this.
"Project" -> "Build Options"
Check the selected compiler for each of the Target in the left hand pane.
To change Compiler Options:
"Settings" -> "Compiler and Debugger"
Pick the correct Compiler in the "Selected Compiler" pull down.
NOTE: Making this the default compiler is recommended!
Tim S.
eb:
Well under my Global compiler settings my Selected compiler says Cygwin GCC.
Auto-detect set the Compiler's installation directory to C:\Cygwin.
Global compiler settings->Toolchain executables->[tab]Program files->C compiler is C:\cygwin\bin\x86_64-w64-mingw32-gcc.exe .
eb:
So i tried starting from scratch.
I started a new project with a new name.
Main.c and rap.h are both in the C:\cygwin\home\eb\rap02 directory.
I have also entered 'C:\cygwin\home\eb\rap02' into Search directories->[tab]Compiler (under Global compiler settings).
The Selected compiler is still Cygwin GCC.
So now main.c contains '#include rap.h' and with Compiler logging set to Full command line my Build log says:
-------------- Build: Debug in rap02 ---------------
x86_64-w64-mingw32-gcc.exe -Wall -g -IC:/cygwin/home/eb/rap02 -c C:/cygwin/home/eb/rap02/main.c -o obj/Debug/main.o
cygwin warning:
MS-DOS style path detected: C:/cygwin/home/eb/rap02/main.c
Preferred POSIX equivalent is: /cygdrive/c/cygwin/home/eb/rap02/main.c
CYGWIN environment variable option "nodosfilewarning" turns off this warning.
Consult the user's guide for more details about POSIX paths:
http://cygwin.com/cygwin-ug-net/using.html#using-pathnames
C:/cygwin/home/eb/rap02/main.c:10:17: fatal error: rap.h: No such file or directory
compilation terminated.
Process terminated with status 1 (0 minutes, 0 seconds)
1 errors, 0 warnings
eb:
OK you win. I'm switching back to non-cygwin headers/libs BUT this codeBlocks problem is still a problem!
stahta01:
Under Compiler Settings "Other Settings"
Check-mark "Explicitly add project top-level directly to compiler search dirs"
Note: The one above this might be more correct. I sometimes check mark them both.
Tim S.
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version