Code::Blocks Forums

User forums => Using Code::Blocks => Topic started by: avestruz on July 13, 2016, 12:31:48 PM

Title: Problem including source files from other folders
Post by: avestruz on July 13, 2016, 12:31:48 PM
Hello, I recently moved some files from my current project's folder to a library folder, but now I am not being able to compile it. I deleted the source files from the current project and added them again from the current library folder. They were added without problems, when I call alt+f2 I can see them added in the project tree in their new folder. I then proceeded to change the include that takes care of one file used. I changed it from #include "FileManager.h" to #include "../framework/FileManager.h" However when I try to compile the project I receive:

Quoteerror: ./framework/FileManager.h: No such file or directory|

Besides a lot of
Quoteerror: 'Anything from FileManager' was not declared in this scope

I went to settings, compiler and debugger, Search directories tab, to both compiler and linker tabs and added the pathname to the framework to see if it worked. Nothing.

However, if I add the full pathname in the include, #include "/dir1/dir2/.../.../framework/FileManager.h" I am able to compile without problems.

Apparently my problem is equal to this here: http://forums.next.codeblocks.org/index.php/topic,13709.15.html that ended without a full solution.

On the project's .cbp file, I can see lots of
Quote<Unit filename="../framework/FileManager.cpp" />
which for me seems about right.

So I would appreciate any recommendations to try to solve the matter.
Title: Re: Problem including source files from other folders
Post by: stahta01 on July 13, 2016, 05:37:19 PM
Please read these two FAQs
http://wiki.codeblocks.org/index.php/FAQ-Compiling_%28errors%29#Q:_How_do_I_troubleshoot_a_compiler_problem.3F (http://wiki.codeblocks.org/index.php/FAQ-Compiling_%28errors%29#Q:_How_do_I_troubleshoot_a_compiler_problem.3F)
and
http://wiki.codeblocks.org/index.php/FAQ-Compiling_%28general%29#Q:_I_would_like_to_compile_a_project_using_some_non-standard_libraries._How_can_I_indicate_to_CodeBlocks_that_these_libraries_and_include_files_exist.3F (http://wiki.codeblocks.org/index.php/FAQ-Compiling_%28general%29#Q:_I_would_like_to_compile_a_project_using_some_non-standard_libraries._How_can_I_indicate_to_CodeBlocks_that_these_libraries_and_include_files_exist.3F)

Then, if you have NOT figured out the problem post your full rebuild log (and file layout info might be needed, also).

Tim S.

Title: Re: Problem including source files from other folders
Post by: oBFusCATed on July 14, 2016, 12:08:40 AM
Quote from: avestruz on July 13, 2016, 12:31:48 PM
However when I try to compile the project I receive:

Quoteerror: ./framework/FileManager.h: No such file or directory|
Is this a copy-paste error or this is the real output of the compiler? I'm talking about ./ instead of ../ in the beginning.