Read this: http://wiki.codeblocks.org/index.php?title=FAQ#Q:_How_do_I_troubleshoot_an_compiler_problem.3F
right-click project name -- Add files -- select file.h and click OK
I can't understand why, with other IDE is easier....because you forgot to add the path of your files to the compiler's include directories (thus telling the compiler where to look for include files). Just add "." (the dot).
main.cpp
file1.h
file1.cc
data/file2.h
file3.h
main.cpp
file1.h
file1.cc
data/file2.h
data1/file4.h
file3.h
Hi,
I have found the source of my problem. My description in the previous post was not completely correct...I'm sorry. If my project is like this:CodeAll works fine, but If my project is like thismain.cpp
file1.h
file1.cc
data/file2.h
file3.hCodewith #include "file4.h" inside the file file2.h, I get all the previous errors: no such file file4.h. So I can deduce that Code::block doesn't support multiple folders! Is it correct?Is there a workaround?main.cpp
file1.h
file1.cc
data/file2.h
data1/file4.h
file3.h
Hi,
I have found the source of my problem. My description in the previous post was not completely correct...I'm sorry. If my project is like this:CodeAll works fine, but If my project is like thismain.cpp
file1.h
file1.cc
data/file2.h
file3.hCodewith #include "file4.h" inside the file file2.h, I get all the previous errors: no such file file4.h. So I can deduce that Code::block doesn't support multiple folders! Is it correct?Is there a workaround?main.cpp
file1.h
file1.cc
data/file2.h
data1/file4.h
file3.h
If you use #include "file4.h", you should add the "." and the "./data1" to the include path.
So I can deduce that Code::block doesn't support multiple folders! Is it correct?
Thank you for your answer. I have not said that I'm under windows 7 with cygwin bash shell and g++/gcc 4.3.4 version1 compiler. I'm still trying to solve the problem, other suggestions are well accepted. Thank in advanced.I think cygwin gcc only recognize the path like "/cygdrive/", so if you use windows path, the gcc compiler may work wrongly.
Thank you for your answer. I have not said that I'm under windows 7 with cygwin bash shell and g++/gcc 4.3.4 version1 compiler. I'm still trying to solve the problem, other suggestions are well accepted. Thank in advanced.I think cygwin gcc only recognize the path like "/cygdrive/", so if you use windows path, the gcc compiler may work wrongly.
Could you try to use mingw gcc?
You're joking...
1. Have you tried to replace #include "file4.h" with #include "../data1/file4.h" or #include "data1/file4.h"?
2. Have you tried to add "./data1/" to the include paths?