Including files from another folders in eclipse - c++

I've ordered a bit my structure of classes and moved the related ones to more specific folders. The problem is that now the includes I made are not being able to find the class, as right now is in another folder.
Why is it not looking automatically for the file through all the folders?
I shouldn't have to write #include "Gameplay/TestMap.hpp". How can I avoid this?
Thanks

You can find how to add paths in eclipse Help

Related

Change include paths

I have a C++ solution that uses several external libraries. For that to work, the compiler needs to be able to find all the header files. Currently this works by hard-coding the header locations into the various project files. But since the headers are installed in a different location on each computer, that means the project will only build on one machine.
What is the "correct" way to deal with this problem?
I feel like there should be a way to define which libraries each project needs, and then a separate file somewhere that says where those libraries are on this particular machine. But I don't know if MSBuild has anything remotely like that.
(Obviously, as well as the header files, we have exactly the same problem with the linker needing to find the object code to link in.)
It seems you can in fact fix this using environment variables. Either through the Visual Studio user interface itself, or just by editing the *.vcxproj file in a text editor, edit the include path from
D:\Libraries\Boost\32bit\include;D:\Libraries\GTest\32bit\include
to instead be something like
$(BOOST_ROOT)\include;$(GTEST_ROOT)\include
Now the project builds on any machine where the environment variable %BOOST_ROOT% is set to the right folder path. (And likewise for %GTEST_ROOT%.)

Python: select only folders in a directory

I am wondering about a good way to isolate just the folders in any given directory. Right now I have a folder with both, folders and random files in it and I want to isolate just the folders and ignore the files, whatever they may be called. Is there a quick way to do this in python?
Cheers
This may be a duplicate question. Please check out this link and see if it serves your purpose :
How to list only top level directories in Python?

Trouble creating custom folders in CodeBlocks

I am have a lot of trouble with CodeBlocks currently that is leaving me really frustrated. Basically, all I want to do is create my own folders within code blocks, and move my files into them.
Currently I am using default settings which forces file types into their own kind of virtual folder. I have a Sources folder with all of my .cpp files, and a Headers folder with all of my .h folders. All I want is a traditional layout.
For example, it is currently impossible for me to create a folder called Input which has both my input cpp and h files. While I looked online, I found an example where someone had this set up which has actual folders, where this is my current set up. Sources and Headers only exists in editor, and not in my actual folders. Do you have any idea how to fix this? I am trying to follow some tutorials that require the creation of folders : /
Thank you!

Create a Second C++ Project in Visual Studio 2010

I am looking for detailed steps to create a second Static Lib Project in Visual Studio 2010
that my first project will reference.
This project will be in source control and used by others so the referencing needs to be able to work on all folder structures. (if possible)
I have done this before but have had problems recently. I mostly end up adding random references to everything and every folder in my project until it works as I do not know the correct steps to accomplish it.
This will be my projects folder structure
<Whatever Structure>/MyProject/MainProject
<Whatever Structure>/MyProject/SecondProject
<Whatever Structure>/MyProject/MyProject.sln
I need my SecondProject to be built as a Static Lib library.
Inside my FirstProject I would like to reference files from my SecondProject as
#include <SecondProject/<filename or class or namespace>
As I said above Detailed Steps to accomplish this would be greatly appreciated.
I have searched many other posts but most just pertain to Header Files or they are half the steps.
Thank you.
#include is solely used for headers. This is parsed at compile time. Since you want to use headers from <Whatever>/MyProject/SecondProject as just SecondProject/, obviously <Whatever>/MyProject/ must be among the include directories. Probably the best way to specify it would be as just ../, because that means you don't have to hardcode <Whatever>
After compiling, the next step is linking. The easiest solution here is to go the the property pages of MainProject, Common Properties > Frameworks & References, and use [Add New Reference...] button. Linking will make the compiled functions inside the .lib available.

visual c++ include folders, libraries, etc

I'm an engineer, not a strong programmer. I'm writing some simulations using openGL and freeglut. I develop on my computer at home or at school or work so I need to keep everything contained. Typically I've gotten things to work by placing needed libraries in my solution folder and linking to them in the project properties. Any header files I've also put in the solution folder (or subfolder if already defined e.g. GL/freeglut.h). Then in my source files I use a command like #include "GL/freeglut.h" with quotes. In my most recent project I'm having problems with another set of headers that deal with hardware that have classes with the same name. It is my understanding that if you keep your headers in separate folders and be careful with namespaces there shouldn't be a problem. I can also configure additional include folders for the project then I use a command like #include <GL/freeglut.h>. What is the best way to set all of this up?