Say I have two independent .cpp
codes in two different directories: (please note that this is just a schematic of my question).
Here is the first one ... which can be successfully compiled in its own directory which has its own Makefile
// special libraries to include
#include "acado.h"
#include "auxiliary_functions.c"
/* -------------------------- */
// Create objects for special classes
ACADOvariables acadoVariables;
ACADOworkspace acadoWorkspace;
int main(){
// perform task A_1
// perform task A_2
// Tasks A_1 and A_2 depend on the specially included headers
return 0;
}
And, here is the second one ... Again, this code can be successfully compiled in its own directory which has its own Makefile
#include <stdio.h>
#include <stdlib.h>
#include "Aria.h"
/* -------------------------- */
// Create objects for special classes
ArPose pose;
ArRobot robot;
int main(){
// perform task B_1
// perform task B_2
// Tasks B_1 and B_2 depend on the specially included headers
return 0;
}
Now, for my purposes, I need to have a source code like ...
// special libraries to include from both packages
#include <stdio.h>
#include <stdlib.h>
#include "Aria.h"
#include "acado.h"
#include "auxiliary_functions.c"
/* -------------------------- */
// Create objects for special classes from Part1
ACADOvariables acadoVariables;
ACADOworkspace acadoWorkspace;
/* -------------------------- */
// Create objects for special classes from part2
ArPose pose;
ArRobot robot;
int main(){
// perform task B_1
// perform task A_1 (this task depends on values returned by B_1)
// perform task B_2 (this task depends on values returned by A_1)
// perform task A_2 (this task depends on values returned by B_1)
return 0;
}
So, how can I use the two packages, and the two makefiles that I already have to compile this last piece of code ? ... I tried to put both packages contents (files and folders) into a single directory, with a makefile that contains both contents of the individual makefiles, but this was not successful to compile the third script...
Your help is really appreciated ...