Add Project to Another Project
-
I have a project that contains classes that are underdevelopment and I want to use those classes in other projects. Moreover, I what any changes I make in another project using those classes to be reflected in the original project. My problem is there id no consistency. I found two ways to do what I want, but they sometime work and other times they do not.
Method 1. Modify the .pro file to add the header and source files. When I do this I should be shown the path to the original project and all of the source and header file below. In the path I get that, but today only noe file shows.
Method 2. Months ago with an older version of Creator I used the add new>add existing directory to accomplish the same thing, but that no longer works.
My question is what is the correct way to do what I want to do?
-
@ofmrew
Bundle these files in a .pri file,
and include it in each of your .pro with:
include(path/xxx.pri) -
@ofmrew
I get the message ":-1: error: Cannot read /home/bob/GravitationalAssist/..\home\bob\My3DLib.pri: No such file or directory"In the .pro file is "include(..\home\bob\My3DLib.pri)"
And the file is at that location and contains:
SOURCES +=
../My3DLib/FreeFun.cpp
../My3DLib/StateVariable.cpp
../My3DLib/Vector3.cpp
../My3DLib/Vector4.cpp
../My3DLib/Matrix3x3.cpp
../My3DLib/Matrix4x4.cppHEADERS +=
../My3DLib/FreeFun.h
../My3DLib/StateVariable.h
../My3DLib/Vector3.h
../My3DLib/Vector4.h
../My3DLib/Matrix3x3.h
../My3DLib/Matrix4x4.hWhat do I need?
-
@ofmrew
I get the message ":-1: error: Cannot read /home/bob/GravitationalAssist/..\home\bob\My3DLib.pri: No such file or directory"In the .pro file is "include(..\home\bob\My3DLib.pri)"
And the file is at that location and contains:
SOURCES +=
../My3DLib/FreeFun.cpp
../My3DLib/StateVariable.cpp
../My3DLib/Vector3.cpp
../My3DLib/Vector4.cpp
../My3DLib/Matrix3x3.cpp
../My3DLib/Matrix4x4.cppHEADERS +=
../My3DLib/FreeFun.h
../My3DLib/StateVariable.h
../My3DLib/Vector3.h
../My3DLib/Vector4.h
../My3DLib/Matrix3x3.h
../My3DLib/Matrix4x4.hWhat do I need?
-
@ofmrew said in Add Project to Another Project:
In the .pro file is "include(..\home\bob\My3DLib.pri)"
Obsiously the path is wrong.
Show your files hierarchy structure. -
Hi,
You should stop using backslashes for your paths especially on non Windows platform.