Bug #14995 2009-01-03 06:16

rich_sposato

GCC follows #include from wrong directory

I have these files in my directory.

ut / UnitTest.cbp

ut / src / UnitTest.cpp

ut / include / UnitTest.hpp

The source code file has this line it:

#include "../include/UnitTest.hpp"

When I compile using Code::Blocks with GCC, I get this error message:

ut/src/UnitTest.cpp:22:35: ../include/UnitTest.hpp: No such file or directory

The header file clearly exists, but the compiler does not find the file by following the #include path.

If I change the #include line to this:

#include "include/UnitTest.hpp"

then Code::Blocks finds the header file.

If I move the UnitTest.cbp into the ut/src directory, and adjust the paths to the UnitTest.cpp and UnitTest.hpp files, then Code::Blocks finds the header file.

If I run GCC on the command line, then it finds the header file - so this is not a GCC bug.

I only see the problem when compiling using Code::Blocks.

Category
Compiler
Group
 
Status
Closed
Close date
2013-02-13 05:23
Assigned to
biplab
biplab 2013-02-13 05:23

Please try with a nightly build and reopen this bug report, if

needed.

See http://forums.codeblocks.org/index.php/board,20.0.html