Execute multiple Apps in main.cpp


In main.cpp, when executing more than one App, the error message is shown below:

terminate called after throwing an instance of ‘std::runtime_error’
what(): Can only create one app in the process.
Aborted (core dumped)

Is there any way to execute more than one App in main.cpp?

Dear songwen.huang,

Could you provide some more detail info?
Because we don’t know which main.cpp you’re using and which part you’ve added.
If ‘can only create one app in the process’, I guess the main.cpp have some limitations like RM, memory assignment, etc. Thanks.

Dear SteveNV,

My main.cpp is shown as follows:

int main(int argc, const char** argv)

ProgramArguments args(argc, argv,
                          "sample which detects objects of multiple classes.");

CaseApp1 app(args);
app.initializeWindow("CaseApp1", 1280, 800, args.enabled("offscreen"));

CaseApp2 app1(args);
app1.initializeWindow("CaseApp2", 1280, 800, args.enabled("offscreen"));

return 0;


How can I display the results of CaseApp1 and CaseApp2 on the same video?


Dear songwen.huang,

If create two separate apps, does it work normally?
I think you can refer to “sample_camera_multiple_gmsl” source code for your case.