adding include path

General questions regarding the usage of CodeLite
lane
CodeLite Curious
Posts: 8
Joined: Wed Feb 17, 2016 1:35 am
Genuine User: Yes
IDE Question: C++
Contact:

adding include path

Post 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
User avatar
eranif
CodeLite Plugin
Posts: 6375
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: adding include path

Post by eranif »

Please read the "HOW TO POST" thread (see my signature)
and provide more information

Eran
Make sure you have read the HOW TO POST thread
lane
CodeLite Curious
Posts: 8
Joined: Wed Feb 17, 2016 1:35 am
Genuine User: Yes
IDE Question: C++
Contact:

Re: adding include path

Post 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====
User avatar
eranif
CodeLite Plugin
Posts: 6375
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: adding include path

Post 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
Make sure you have read the HOW TO POST thread
lane
CodeLite Curious
Posts: 8
Joined: Wed Feb 17, 2016 1:35 am
Genuine User: Yes
IDE Question: C++
Contact:

Re: adding include path

Post 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"
User avatar
eranif
CodeLite Plugin
Posts: 6375
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: adding include path

Post by eranif »

Can you print the content of the directory C:\ox ?

Eran
Make sure you have read the HOW TO POST thread
lane
CodeLite Curious
Posts: 8
Joined: Wed Feb 17, 2016 1:35 am
Genuine User: Yes
IDE Question: C++
Contact:

Re: adding include path

Post 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
User avatar
eranif
CodeLite Plugin
Posts: 6375
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: adding include path

Post 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
Make sure you have read the HOW TO POST thread
lane
CodeLite Curious
Posts: 8
Joined: Wed Feb 17, 2016 1:35 am
Genuine User: Yes
IDE Question: C++
Contact:

Re: adding include path

Post 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
User avatar
eranif
CodeLite Plugin
Posts: 6375
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: adding include path

Post by eranif »

Do you find Polygon.h or Polygon.hpp or both?

Eran
Make sure you have read the HOW TO POST thread
Post Reply