How to generate multiple executables from single project and other anomolies

tlaritz
Posts: 9
Joined: Tue Mar 15, 2022 3:01 am

How to generate multiple executables from single project and other anomolies

Postby tlaritz » Tue Mar 15, 2022 3:22 am

Hi
This question has been asked before but I can't seem to apply the answer in my case, and I am seeing other strange behavior in my project.

I have both .h and .cpp files I'd like to share between executables. I currently have a main.cpp and main2.cpp, both with an app_main() defined and both being included as COMPONENT_SRCS in the CMakeLists.txt. I have the following anomalies:

1. The project successfully compiles even though app_main is defined twice (in different files).
2. Even though the project compiles, the editor produces a red underline indicating an unresolved inclusion (for #include of header files) and "symbol GPIO_NUM_25 could not be resolved" for constants and variables. The redlines therefore mean nothing to me...
3. To produce multiple executables from one project, others have suggested creating two configurations (which I take to mean application configurations) and then excluding the "opposite" main from each configuration by right clicking on the main.cpp file, selecting Resource Configurations->Exclude from build... However, both options available under "Resource Configurations" (ie, Exclude from build and Reset to Default) are greyed out such that they cannot be clicked upon.

I've search the web wide and far and can't seem to find an approach to my problems. I was getting a error (something like Incorrect Build Configuration) upon cleaning the project, but I found a problem report with a work around to that issue.

So, I believe I have done my due diligence to resolve my questions on my own, but am still befuddled. Any help would be appreciated.

Tom

tlaritz
Posts: 9
Joined: Tue Mar 15, 2022 3:01 am

Re: How to generate multiple executables from single project and other anomolies

Postby tlaritz » Tue Mar 15, 2022 5:50 am

PS. The "Build not configured correctly" has returned despite my doing the work around: File->Restart.

Who is online

Users browsing this forum: No registered users and 53 guests