Page 1 of 2

adding include path

Posted: Thu Mar 10, 2016 5:15 am
by lane
Hello, I am trying to add a file that has a bunch of .h files inside, so I went to the project settings --> compiler tab --> Include Paths. I then put the C:\"path to .h files".
When I try to #include any from the list, it doesn't acknowledge that there is a directory or file called that. I am using TDM-GCC-32. any help would be much appreciated!

Thanks,
lane

Re: adding include path

Posted: Thu Mar 10, 2016 9:24 am
by eranif
Please read the "HOW TO POST" thread (see my signature)
and provide more information

Eran

Re: adding include path

Posted: Fri Mar 11, 2016 2:36 am
by lane
Sorry about that!

Codelite 9.1.0
Windows 10
TDM-GCC-32 version 5.1.0

Build Problem: specifically includes

Code: Select all

C:\WINDOWS\system32\cmd.exe /C C:/TDM-GCC-32/bin/mingw32-make.exe -j4 SHELL=cmd.exe -e -f  Makefile
"----------Building project:[ New - Debug ]----------"
mingw32-make.exe[1]: Entering directory 'C:/Projects/New'
mingw32-make.exe[1]: Leaving directory 'C:/Projects/New'
mingw32-make.exe[1]: Entering directory 'C:/Projects/New'
C:/TDM-GCC-32/bin/g++.exe  -c  "C:/Projects/New/main.cpp" -g -O0 -Wall  -o ./Debug/main.cpp.o -IC:/ox  -I. -IC:/ox
C:/Projects/New/main.cpp:1:21: fatal error: Polygon.h: No such file or directory
compilation terminated.
mingw32-make.exe[1]: *** [Debug/main.cpp.o] Error 1
New.mk:97: recipe for target 'Debug/main.cpp.o' failed
mingw32-make.exe[1]: Leaving directory 'C:/Projects/New'
mingw32-make.exe: *** [All] Error 2
Makefile:4: recipe for target 'All' failed
====2 errors, 0 warnings====

Re: adding include path

Posted: Fri Mar 11, 2016 12:34 pm
by eranif
Is the file Polygon.h exists under C:/ox ?
How did you include it in your code?

Note that this is not a CodeLite related issue, its basic C/C++

Eran

Re: adding include path

Posted: Sat Mar 12, 2016 8:30 am
by lane
eranif wrote:Is the file Polygon.h exists under C:/ox ?
How did you include it in your code?
Yes! Polygon.h is inside C:/ox .

my code for including the file is:

Code: Select all

#include "Polygon.h"

Re: adding include path

Posted: Sat Mar 12, 2016 8:51 am
by eranif
Can you print the content of the directory C:\ox ?

Eran

Re: adding include path

Posted: Sat Mar 12, 2016 7:58 pm
by lane
I don't think that I can..There are many Header files inside. When I go to their properties they are .hpp files. Then, when I tried to include it I tried:

Code: Select all

#include "Polygon.hpp"
That yielded me with an error that says:

Code: Select all

C:\WINDOWS\system32\cmd.exe /C C:/TDM-GCC-32/bin/mingw32-make.exe -j4 SHELL=cmd.exe -e -f  Makefile
"----------Building project:[ New - Debug ]----------"
mingw32-make.exe[1]: Entering directory 'C:/Projects/New'
mingw32-make.exe[1]: Leaving directory 'C:/Projects/New'
mingw32-make.exe[1]: Entering directory 'C:/Projects/New'
C:/TDM-GCC-32/bin/g++.exe  -c  "C:/Projects/New/main.cpp" -g -O0 -Wall  -o ./Debug/main.cpp.o -IC:/ox  -I. -IC:/ox
In file included from C:/Projects/New/main.cpp:6:0:
C:/ox/Polygon.hpp:1:21: fatal error: Polygon.h: No such file or directory
compilation terminated.
mingw32-make.exe[1]: *** [Debug/main.cpp.o] Error 1
New.mk:97: recipe for target 'Debug/main.cpp.o' failed
mingw32-make.exe[1]: Leaving directory 'C:/Projects/New'
mingw32-make.exe: *** [All] Error 2
Makefile:4: recipe for target 'All' failed
====2 errors, 1 warnings====
It also opened up Polygon.hpp , but all that was in there was #include "Polygon.h" .

This may just be a general c++ problem, as you said Eran. If you know of any resources that could teach me about using header files that I did not make, I think it will be a bit more productive.

lane

Re: adding include path

Posted: Sat Mar 12, 2016 8:18 pm
by eranif
C:/ox/Polygon.hpp:1:21: fatal error: Polygon.h: No such file or directory
The compiler *finds* Plolygon.hpp but it can not find included from within this file "Polygon.h"
Does this file exist under c:\ox ?

Eran

Re: adding include path

Posted: Sun Mar 13, 2016 12:11 am
by lane
I'm not understanding:
Does this file exist under c:\ox ?
When you say that, do you mean, go to C:/ox and look if there is a header file called Polygon? If so, yes. I go to C:/ox and find Polygon.

lane

Re: adding include path

Posted: Sun Mar 13, 2016 12:58 am
by eranif
Do you find Polygon.h or Polygon.hpp or both?

Eran