How to include headers from another project?
Posted: Tue Dec 10, 2013 2:42 pm
Hello Codeliters! please be patient, I'm a newbie here.
I have coded a basic singly linked list class for testing, and compiled it as a dynamic library using codelite. Folder/file structure is as follows:
Work/SingleIntList:
Debug SingleIntList.project singly_int_list.cpp
SingleIntList.mk SingleIntList.txt singly_int_list.h
Work/SingleIntList/Debug:
SingleIntList.so singly_int_list.o singly_int_list.o.d
I have also created a workspace and a project inside it
Work/TestSIL:
Makefile TestSIL TestSIL.workspace
Work/TestSIL/TestSIL:
Debug main.cpp TestSIL.mk TestSIL.project
Work/TestSIL/TestSIL/Debug:
main.o.d
In this workspace (TestSIL) I have "added an existing project" and then selected SingleIntList. So far so good, I have both projects in the TestSIL workspace, but when I compile it terminates with the following error:
/home/mario/Work/TestSIL/TestSIL/main.cpp:2:43: fatal error: SingleIntList/singly_int_list.h: No such file or directory
This is the source for main.cpp in the TestSIL project (so you can see how I'm including the header from the other project):
How should I set things up in order to build this project successfully in this layout?
I have coded a basic singly linked list class for testing, and compiled it as a dynamic library using codelite. Folder/file structure is as follows:
Work/SingleIntList:
Debug SingleIntList.project singly_int_list.cpp
SingleIntList.mk SingleIntList.txt singly_int_list.h
Work/SingleIntList/Debug:
SingleIntList.so singly_int_list.o singly_int_list.o.d
I have also created a workspace and a project inside it
Work/TestSIL:
Makefile TestSIL TestSIL.workspace
Work/TestSIL/TestSIL:
Debug main.cpp TestSIL.mk TestSIL.project
Work/TestSIL/TestSIL/Debug:
main.o.d
In this workspace (TestSIL) I have "added an existing project" and then selected SingleIntList. So far so good, I have both projects in the TestSIL workspace, but when I compile it terminates with the following error:
/home/mario/Work/TestSIL/TestSIL/main.cpp:2:43: fatal error: SingleIntList/singly_int_list.h: No such file or directory
This is the source for main.cpp in the TestSIL project (so you can see how I'm including the header from the other project):
Code: Select all
#include <iostream>
#include <SingleIntList/singly_int_list.h>
using namespace std;
int main()
{
SinglyIntList j;
j.prepend(5);
cout << "Hola, Mundo" << endl;
return 0;
}