User forums > Using Code::Blocks
Add existing file to a project
erotavlas:
Hi,
I'm new of Code::Block. I don't know how I can add an existing file to a project. If I add a file to a project clicking on project->add file recursively, Code::Block will add the file to my project. When I try to compile the project I get error from compiler, it can't find the added file from #include in other file.
data/myaddedfile.h
myfile.h (#include "myaddedfile.h")
main.cpp
I don't know why?
Thank
oBFusCATed:
Read this: http://wiki.codeblocks.org/index.php?title=FAQ#Q:_How_do_I_troubleshoot_an_compiler_problem.3F
erotavlas:
--- Quote from: oBFusCATed on November 17, 2010, 03:42:38 pm ---Read this: http://wiki.codeblocks.org/index.php?title=FAQ#Q:_How_do_I_troubleshoot_an_compiler_problem.3F
--- End quote ---
Ok, thank you very much for your fast answer. I have read it and I know with other IDE how I can add a my existing file. I don't understand why Code::block can't allow to add an existing file in simple way.
I'm still getting this error:
file.h: No such file or directory
xunxun:
right-click project name -- Add files -- select file.h and click OK
Jenna:
It's a configuration error.
If the header file is not in the xsame directory as the c/cpp-file, you have to use the relative path in the include-statement or add the path to the compilers search directories in projects build options.
Navigation
[0] Message Index
[#] Next page
Go to full version