User forums > Using Code::Blocks
Problem including source files from other folders
(1/1)
avestruz:
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
--- Code: ---#include "FileManager.h"
--- End code ---
to
--- Code: ---#include "../framework/FileManager.h"
--- End code ---
However when I try to compile the project I receive:
--- Quote ---error: ./framework/FileManager.h: No such file or directory|
--- End quote ---
Besides a lot of
--- Quote ---error: 'Anything from FileManager' was not declared in this scope
--- End quote ---
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,
--- Code: ---#include "/dir1/dir2/.../.../framework/FileManager.h"
--- End code ---
I am able to compile without problems.
Apparently my problem is equal to this here: http://forums.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" />
--- End quote ---
which for me seems about right.
So I would appreciate any recommendations to try to solve the matter.
stahta01:
Please read these two FAQs
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
Then, if you have NOT figured out the problem post your full rebuild log (and file layout info might be needed, also).
Tim S.
oBFusCATed:
--- Quote from: avestruz on July 13, 2016, 12:31:48 pm ---However when I try to compile the project I receive:
--- Quote ---error: ./framework/FileManager.h: No such file or directory|
--- End quote ---
--- End quote ---
Is this a copy-paste error or this is the real output of the compiler? I'm talking about ./ instead of ../ in the beginning.
Navigation
[0] Message Index
Go to full version