Author Topic: Problem including source files from other folders  (Read 2425 times)

avestruz

  • Guest
Problem including source files from other folders
« 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
Code
#include "FileManager.h"
to
Code
#include "../framework/FileManager.h"
However when I try to compile the project I receive:

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

Besides a lot of
Quote
error: '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,
Code
#include "/dir1/dir2/.../.../framework/FileManager.h"
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" />
which for me seems about right.

So I would appreciate any recommendations to try to solve the matter.

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7590
    • My Best Post
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Problem including source files from other folders
« Reply #2 on: July 14, 2016, 12:08:40 am »
However when I try to compile the project I receive:

Quote
error: ./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.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]