0

Hi, in java, I can use packages to combine classes which have similar traits. For example, I have a package "worker" and classes in this package contains "Programmer.java" and "Designer.java"

I want to know how to do this in C++. What I did was this:
1. created a source folder called "actor"
2. inside the directory, I created an "actor.h" and "actor.cpp"
3. now I created another folder called "camera"
4. I created a "camera.h" and "camera.cpp" inside it.
5. "camera.h" depends on "actor.h" -> this is where the problem started.

It seems that camera.h cannot see actor.h I tried

#include "actor/actor.h"

in the camera.h but it still did not find the header. What am I doing wrong? My goal is just I do not want to put all headers and cpp files in a single directory. Suggestions are welcome. Thanks!

2
Contributors
1
Reply
2
Views
7 Years
Discussion Span
Last Post by Ancient Dragon
0

C/C++ use "libraries", and "dll"s (MS-Windows) not packages. How to create one depends on the compiler you are using. Normally the source code for a library is all in one folder, and it doesn't matter what the folder name is as long as your compiler knows.

Edited by Ancient Dragon: n/a

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.