.h file cannot see another in the same folder C++ EclipseCan I call a constructor from another constructor (do constructor chaining) in C++?How do I include a JavaScript file in another JavaScript file?C++ code file extension? .cc vs .cppC++: hashtable - Why won't this compile?Read file line by line using ifstream in C++Include another HTML file in a HTML fileCan't compile basic C++ program with TBB and lambdaWhy can I not call reserve on a vector of const elements?Why can I not std::partition this std::unordered_map?SFML ERROR I know you know something about it

Can I shorten this filter, that finds disk sizes over 100G?

Can living where Rare Earth magnetic ore is abundant provide any protection from cosmic radiation?

Best Ergonomic Design for a handheld ranged weapon

Correct word for a little toy that always stands up?

How would a lunar colony attack Earth?

Derivative is just speed of change?

How did Biff return to 2015 from 1955 without a lightning strike?

Just how much information should you share with a former client?

Move arrows along a contour

What to expect in a jazz audition

Does Ubuntu reduce battery life?

In the Schrödinger equation, can I have a Hamiltonian without a kinetic term?

When did J.K. Rowling decide to make Ron and Hermione a couple?

Why is Searing Smite not listed in the Roll20 Spell books?

Can starter be used as an alternator?

Create and use Object Variable

What are these hats and the function of those wearing them? worn by the Russian imperial army at Borodino

Best practice for keeping temperature constant during film development at home

If I buy and download a game through second Nintendo account do I own it on my main account too?

Can machine learning learn a function like finding maximum from a list?

Why is “deal 6 damage” a legit phrase?

How to get Planck length in meters to 6 decimal places

Balancing Humanoid fantasy races: Elves

What force enables us to walk? Friction or normal reaction?



.h file cannot see another in the same folder C++ Eclipse


Can I call a constructor from another constructor (do constructor chaining) in C++?How do I include a JavaScript file in another JavaScript file?C++ code file extension? .cc vs .cppC++: hashtable - Why won't this compile?Read file line by line using ifstream in C++Include another HTML file in a HTML fileCan't compile basic C++ program with TBB and lambdaWhy can I not call reserve on a vector of const elements?Why can I not std::partition this std::unordered_map?SFML ERROR I know you know something about it






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








0















The weird thing about this problem is that other .cpp and .h files can find the file but not this one, they're all in the SAME folder. My file structure is as follows:



/Entity.h // is being included



/Graphics.cpp // can include



/Graphics.h // CANNOT include



/main.cpp // can include



/Physics.cpp // can include



/Physics.h // can include



Graphics.cpp, main.cpp, Physics.cpp, Physics.h are all able to include Entity.h but Graphics.h cannot.



This is Entity.h



#ifndef ENTITY_H
#define ENTITY_H

#include <vector>
#include <SFML/Graphics.hpp>

using namespace std;

struct entity

int ID;
vector<long double> position;
vector<long double> velocity;
vector<long double> acceleration;
sf::Color colour;
sf::CircleShape selfImage;
long double mass;
;

entity createEntity(long double x, long double y, long double xV, long double yV, long double m, int newID)

entity e;
// assign entity ID and increment entity ID count
e.ID = newID;

// initialise velocity, acceleration & position to 0
e.position.resize(2, 0);
e.velocity.resize(2, 0);
e.acceleration.resize(2, 0);

e.position = x, y;
e.velocity = xV, yV;

// setup self-image
e.colour = sf::Color (255, 0, 0);
e.selfImage.setFillColor(e.colour);

// initialise mass
e.mass = m;

return e;
;


#endif // ENTITY_H


This is Graphics.h



/*
* Graphics.h
*
* Created on: 26 Mar 2019
* Author: chris
*/
#ifndef GRAPHICS_H_
#define GRAPHICS_H_

#include <SFML/Graphics.hpp>
#include <vector>
#include <Entity.h>

class Graphics

public:
Graphics(int WIDTH, int HEIGHT);
~Graphics();
void update(vector<entity> entities);

int W_WIDTH;
int W_HEIGHT;
sf::RenderWindow window;

;



#endif /* GRAPHICS_H_ */


Physics.h, an example of something which can include Entity.h



#ifndef PHYSICS_H
#define PHYSICS_H

#include <Entity.h>
#include <vector>
using namespace std;


class Physics

long double G_CONST = 0.00000000006674;
public:
Physics();
virtual ~Physics();

const int MAP_WIDTH = 1000;
const int MAP_HEIGHT = 1000;

vector<vector<entity*>> gameMap;
vector<entity> entityList;

void addEntity(entity e);
int update();

protected:

private:
;

#endif // PHYSICS_H


The console output is the following



make all 
Building file: ../Graphics.cpp
Invoking: Cross G++ Compiler
g++ -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"Graphics.d" -MT"Graphics.o" -o "Graphics.o" "../Graphics.cpp"
In file included from ../Graphics.cpp:7:
../Graphics.h:12:10: fatal error: ./Entity.h: No such file or directory
#include <./Entity.h>
^~~~~~~~~~~~
compilation terminated.
make: *** [subdir.mk:26: Graphics.o] Error 1
"make all" terminated with exit code 2. Build might be incomplete.


I am using Eclipse on Debian. This has me puzzled, I cannot see a difference in the files.



EDIT:
using "" instead of <> around the include statements file name fixed the problem. Other problems have ensued however :((((((










share|improve this question


























  • Have you changed your include path?

    – immibis
    Mar 26 at 22:36











  • nope, i’ve just created a CDT project in Eclipse and away I went. I did add SFML’s include folder to /usr/include but apart from that, no

    – AshKetchupp
    Mar 26 at 23:03











  • I would try without the ./ before Entity.h

    – drescherjm
    Mar 26 at 23:06












  • Maybe you have more than 1 Graphics.h files that are in different folders.

    – drescherjm
    Mar 26 at 23:07











  • How did you include Graphics.h? Using <> or "" ?

    – immibis
    Mar 27 at 0:50

















0















The weird thing about this problem is that other .cpp and .h files can find the file but not this one, they're all in the SAME folder. My file structure is as follows:



/Entity.h // is being included



/Graphics.cpp // can include



/Graphics.h // CANNOT include



/main.cpp // can include



/Physics.cpp // can include



/Physics.h // can include



Graphics.cpp, main.cpp, Physics.cpp, Physics.h are all able to include Entity.h but Graphics.h cannot.



This is Entity.h



#ifndef ENTITY_H
#define ENTITY_H

#include <vector>
#include <SFML/Graphics.hpp>

using namespace std;

struct entity

int ID;
vector<long double> position;
vector<long double> velocity;
vector<long double> acceleration;
sf::Color colour;
sf::CircleShape selfImage;
long double mass;
;

entity createEntity(long double x, long double y, long double xV, long double yV, long double m, int newID)

entity e;
// assign entity ID and increment entity ID count
e.ID = newID;

// initialise velocity, acceleration & position to 0
e.position.resize(2, 0);
e.velocity.resize(2, 0);
e.acceleration.resize(2, 0);

e.position = x, y;
e.velocity = xV, yV;

// setup self-image
e.colour = sf::Color (255, 0, 0);
e.selfImage.setFillColor(e.colour);

// initialise mass
e.mass = m;

return e;
;


#endif // ENTITY_H


This is Graphics.h



/*
* Graphics.h
*
* Created on: 26 Mar 2019
* Author: chris
*/
#ifndef GRAPHICS_H_
#define GRAPHICS_H_

#include <SFML/Graphics.hpp>
#include <vector>
#include <Entity.h>

class Graphics

public:
Graphics(int WIDTH, int HEIGHT);
~Graphics();
void update(vector<entity> entities);

int W_WIDTH;
int W_HEIGHT;
sf::RenderWindow window;

;



#endif /* GRAPHICS_H_ */


Physics.h, an example of something which can include Entity.h



#ifndef PHYSICS_H
#define PHYSICS_H

#include <Entity.h>
#include <vector>
using namespace std;


class Physics

long double G_CONST = 0.00000000006674;
public:
Physics();
virtual ~Physics();

const int MAP_WIDTH = 1000;
const int MAP_HEIGHT = 1000;

vector<vector<entity*>> gameMap;
vector<entity> entityList;

void addEntity(entity e);
int update();

protected:

private:
;

#endif // PHYSICS_H


The console output is the following



make all 
Building file: ../Graphics.cpp
Invoking: Cross G++ Compiler
g++ -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"Graphics.d" -MT"Graphics.o" -o "Graphics.o" "../Graphics.cpp"
In file included from ../Graphics.cpp:7:
../Graphics.h:12:10: fatal error: ./Entity.h: No such file or directory
#include <./Entity.h>
^~~~~~~~~~~~
compilation terminated.
make: *** [subdir.mk:26: Graphics.o] Error 1
"make all" terminated with exit code 2. Build might be incomplete.


I am using Eclipse on Debian. This has me puzzled, I cannot see a difference in the files.



EDIT:
using "" instead of <> around the include statements file name fixed the problem. Other problems have ensued however :((((((










share|improve this question


























  • Have you changed your include path?

    – immibis
    Mar 26 at 22:36











  • nope, i’ve just created a CDT project in Eclipse and away I went. I did add SFML’s include folder to /usr/include but apart from that, no

    – AshKetchupp
    Mar 26 at 23:03











  • I would try without the ./ before Entity.h

    – drescherjm
    Mar 26 at 23:06












  • Maybe you have more than 1 Graphics.h files that are in different folders.

    – drescherjm
    Mar 26 at 23:07











  • How did you include Graphics.h? Using <> or "" ?

    – immibis
    Mar 27 at 0:50













0












0








0








The weird thing about this problem is that other .cpp and .h files can find the file but not this one, they're all in the SAME folder. My file structure is as follows:



/Entity.h // is being included



/Graphics.cpp // can include



/Graphics.h // CANNOT include



/main.cpp // can include



/Physics.cpp // can include



/Physics.h // can include



Graphics.cpp, main.cpp, Physics.cpp, Physics.h are all able to include Entity.h but Graphics.h cannot.



This is Entity.h



#ifndef ENTITY_H
#define ENTITY_H

#include <vector>
#include <SFML/Graphics.hpp>

using namespace std;

struct entity

int ID;
vector<long double> position;
vector<long double> velocity;
vector<long double> acceleration;
sf::Color colour;
sf::CircleShape selfImage;
long double mass;
;

entity createEntity(long double x, long double y, long double xV, long double yV, long double m, int newID)

entity e;
// assign entity ID and increment entity ID count
e.ID = newID;

// initialise velocity, acceleration & position to 0
e.position.resize(2, 0);
e.velocity.resize(2, 0);
e.acceleration.resize(2, 0);

e.position = x, y;
e.velocity = xV, yV;

// setup self-image
e.colour = sf::Color (255, 0, 0);
e.selfImage.setFillColor(e.colour);

// initialise mass
e.mass = m;

return e;
;


#endif // ENTITY_H


This is Graphics.h



/*
* Graphics.h
*
* Created on: 26 Mar 2019
* Author: chris
*/
#ifndef GRAPHICS_H_
#define GRAPHICS_H_

#include <SFML/Graphics.hpp>
#include <vector>
#include <Entity.h>

class Graphics

public:
Graphics(int WIDTH, int HEIGHT);
~Graphics();
void update(vector<entity> entities);

int W_WIDTH;
int W_HEIGHT;
sf::RenderWindow window;

;



#endif /* GRAPHICS_H_ */


Physics.h, an example of something which can include Entity.h



#ifndef PHYSICS_H
#define PHYSICS_H

#include <Entity.h>
#include <vector>
using namespace std;


class Physics

long double G_CONST = 0.00000000006674;
public:
Physics();
virtual ~Physics();

const int MAP_WIDTH = 1000;
const int MAP_HEIGHT = 1000;

vector<vector<entity*>> gameMap;
vector<entity> entityList;

void addEntity(entity e);
int update();

protected:

private:
;

#endif // PHYSICS_H


The console output is the following



make all 
Building file: ../Graphics.cpp
Invoking: Cross G++ Compiler
g++ -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"Graphics.d" -MT"Graphics.o" -o "Graphics.o" "../Graphics.cpp"
In file included from ../Graphics.cpp:7:
../Graphics.h:12:10: fatal error: ./Entity.h: No such file or directory
#include <./Entity.h>
^~~~~~~~~~~~
compilation terminated.
make: *** [subdir.mk:26: Graphics.o] Error 1
"make all" terminated with exit code 2. Build might be incomplete.


I am using Eclipse on Debian. This has me puzzled, I cannot see a difference in the files.



EDIT:
using "" instead of <> around the include statements file name fixed the problem. Other problems have ensued however :((((((










share|improve this question
















The weird thing about this problem is that other .cpp and .h files can find the file but not this one, they're all in the SAME folder. My file structure is as follows:



/Entity.h // is being included



/Graphics.cpp // can include



/Graphics.h // CANNOT include



/main.cpp // can include



/Physics.cpp // can include



/Physics.h // can include



Graphics.cpp, main.cpp, Physics.cpp, Physics.h are all able to include Entity.h but Graphics.h cannot.



This is Entity.h



#ifndef ENTITY_H
#define ENTITY_H

#include <vector>
#include <SFML/Graphics.hpp>

using namespace std;

struct entity

int ID;
vector<long double> position;
vector<long double> velocity;
vector<long double> acceleration;
sf::Color colour;
sf::CircleShape selfImage;
long double mass;
;

entity createEntity(long double x, long double y, long double xV, long double yV, long double m, int newID)

entity e;
// assign entity ID and increment entity ID count
e.ID = newID;

// initialise velocity, acceleration & position to 0
e.position.resize(2, 0);
e.velocity.resize(2, 0);
e.acceleration.resize(2, 0);

e.position = x, y;
e.velocity = xV, yV;

// setup self-image
e.colour = sf::Color (255, 0, 0);
e.selfImage.setFillColor(e.colour);

// initialise mass
e.mass = m;

return e;
;


#endif // ENTITY_H


This is Graphics.h



/*
* Graphics.h
*
* Created on: 26 Mar 2019
* Author: chris
*/
#ifndef GRAPHICS_H_
#define GRAPHICS_H_

#include <SFML/Graphics.hpp>
#include <vector>
#include <Entity.h>

class Graphics

public:
Graphics(int WIDTH, int HEIGHT);
~Graphics();
void update(vector<entity> entities);

int W_WIDTH;
int W_HEIGHT;
sf::RenderWindow window;

;



#endif /* GRAPHICS_H_ */


Physics.h, an example of something which can include Entity.h



#ifndef PHYSICS_H
#define PHYSICS_H

#include <Entity.h>
#include <vector>
using namespace std;


class Physics

long double G_CONST = 0.00000000006674;
public:
Physics();
virtual ~Physics();

const int MAP_WIDTH = 1000;
const int MAP_HEIGHT = 1000;

vector<vector<entity*>> gameMap;
vector<entity> entityList;

void addEntity(entity e);
int update();

protected:

private:
;

#endif // PHYSICS_H


The console output is the following



make all 
Building file: ../Graphics.cpp
Invoking: Cross G++ Compiler
g++ -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"Graphics.d" -MT"Graphics.o" -o "Graphics.o" "../Graphics.cpp"
In file included from ../Graphics.cpp:7:
../Graphics.h:12:10: fatal error: ./Entity.h: No such file or directory
#include <./Entity.h>
^~~~~~~~~~~~
compilation terminated.
make: *** [subdir.mk:26: Graphics.o] Error 1
"make all" terminated with exit code 2. Build might be incomplete.


I am using Eclipse on Debian. This has me puzzled, I cannot see a difference in the files.



EDIT:
using "" instead of <> around the include statements file name fixed the problem. Other problems have ensued however :((((((







c++ header include eclipse-cdt






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Mar 27 at 16:37







AshKetchupp

















asked Mar 26 at 22:32









AshKetchuppAshKetchupp

63 bronze badges




63 bronze badges















  • Have you changed your include path?

    – immibis
    Mar 26 at 22:36











  • nope, i’ve just created a CDT project in Eclipse and away I went. I did add SFML’s include folder to /usr/include but apart from that, no

    – AshKetchupp
    Mar 26 at 23:03











  • I would try without the ./ before Entity.h

    – drescherjm
    Mar 26 at 23:06












  • Maybe you have more than 1 Graphics.h files that are in different folders.

    – drescherjm
    Mar 26 at 23:07











  • How did you include Graphics.h? Using <> or "" ?

    – immibis
    Mar 27 at 0:50

















  • Have you changed your include path?

    – immibis
    Mar 26 at 22:36











  • nope, i’ve just created a CDT project in Eclipse and away I went. I did add SFML’s include folder to /usr/include but apart from that, no

    – AshKetchupp
    Mar 26 at 23:03











  • I would try without the ./ before Entity.h

    – drescherjm
    Mar 26 at 23:06












  • Maybe you have more than 1 Graphics.h files that are in different folders.

    – drescherjm
    Mar 26 at 23:07











  • How did you include Graphics.h? Using <> or "" ?

    – immibis
    Mar 27 at 0:50
















Have you changed your include path?

– immibis
Mar 26 at 22:36





Have you changed your include path?

– immibis
Mar 26 at 22:36













nope, i’ve just created a CDT project in Eclipse and away I went. I did add SFML’s include folder to /usr/include but apart from that, no

– AshKetchupp
Mar 26 at 23:03





nope, i’ve just created a CDT project in Eclipse and away I went. I did add SFML’s include folder to /usr/include but apart from that, no

– AshKetchupp
Mar 26 at 23:03













I would try without the ./ before Entity.h

– drescherjm
Mar 26 at 23:06






I would try without the ./ before Entity.h

– drescherjm
Mar 26 at 23:06














Maybe you have more than 1 Graphics.h files that are in different folders.

– drescherjm
Mar 26 at 23:07





Maybe you have more than 1 Graphics.h files that are in different folders.

– drescherjm
Mar 26 at 23:07













How did you include Graphics.h? Using <> or "" ?

– immibis
Mar 27 at 0:50





How did you include Graphics.h? Using <> or "" ?

– immibis
Mar 27 at 0:50












0






active

oldest

votes










Your Answer






StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");

StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55367119%2fh-file-cannot-see-another-in-the-same-folder-c-eclipse%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes




Is this question similar to what you get asked at work? Learn more about asking and sharing private information with your coworkers using Stack Overflow for Teams.







Is this question similar to what you get asked at work? Learn more about asking and sharing private information with your coworkers using Stack Overflow for Teams.



















draft saved

draft discarded
















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid …


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55367119%2fh-file-cannot-see-another-in-the-same-folder-c-eclipse%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

How to preserve electronics (computers, tablets and phones) for hundreds of years Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 23, 2019 at 23:30 UTC (7:30pm US/Eastern) The network's official Twitter account is up and running again. What content…How might modern humans leave a message for 50,000 years?How would an aquatic race develop computers?How do we make computers care for human life?Keeping supplies for 1000 yearsWhat will cell phones become in 100 years?What body armor protects against a laser?Could a society attain 1800s technology if limited to using copper and bronze?Electricity power (magic) and electronicsScavenging metal resources in post-apocalypse after 100 yearsWhy would precursors create devices that can survive and still work after hundreds of years?

155 수학 과학 기타 둘러보기 메뉴eh추가해eh문서를 완성해

Convert JSON to MapSimplest way to convert a string representing JSON array into Java array List of key value pairsHow to take String JSON values into HashMapConvert a JSON String to a HashMapCreating BSON object from JSON stringJSONObject - How to get a value ?Better Map ConstructorReading JSON from Url javaUpdate columns if input values are not null otherwise ignore and keep the existing values of column in databaseHow to store object represented as Json string into Couchbase Lite?Go JSON into MapHow do I efficiently iterate over each entry in a Java Map?Sort a Map<Key, Value> by valuesHow to round a number to n decimal places in JavaCan comments be used in JSON?How do I read / convert an InputStream into a String in Java?How can I pretty-print JSON in a shell script?What is the correct JSON content type?How can I deserialize JSON to a simple Dictionary<string,string> in ASP.NET?Why does Google prepend while(1); to their JSON responses?Parse JSON in JavaScript?