Use of deleted function ‘ofApp::ofApp()’

I’m trying to compile a project containing 5 files: main.cpp, ofApp.h, ofApp.cpp, monolith.h, monolith.cpp
When i call make, it gives me the following error:

... -c /home/user/OF/of_v0.11.2_linux64gcc6_release/apps/myApps/Physarum_monolith/src/main.cpp
/home/user/OF/of_v0.11.2_linux64gcc6_release/apps/myApps/Physarum_monolith/src/main.cpp: In function ‘int main()’:
/home/user/OF/of_v0.11.2_linux64gcc6_release/apps/myApps/Physarum_monolith/src/main.cpp:11:28: error: use of deleted function ‘ofApp::ofApp()’
   11 |         ofRunApp(new ofApp());
      |                            ^
In file included from /home/user/OF/of_v0.11.2_linux64gcc6_release/apps/myApps/Physarum_monolith/src/main.cpp:2:
/home/user/OF/of_v0.11.2_linux64gcc6_release/apps/myApps/Physarum_monolith/src/ofApp.h:6:7: note: ‘ofApp::ofApp()’ is implicitly deleted because the default definition would be ill-formed:
    6 | class ofApp : public ofBaseApp{
      |       ^~~~~

Given that i initially created the project with the Project Generator and i haven’t touched the main.cpp file, i cannot understand why “the default definition is ill-formed”

This has happened to me… The real reason is something in your App.h or App.cpp but the compiler shows squiggly lines in main.cpp until you fix it. Check to make sure you’ve defined any const variables and that any other essential variables in your other src scripts are properly defined at construction.

1 Like