For demo projects I often arrange examples by type, with main programs for C, C++, and Fortran in the same directory. FPM 0.7.0 doesn’t seem to handle this setup–it tries to link all the C and C++ code with the Fortran main program and then errors on “multiple main programs”.
A possible fix would be for FPM to detect int main(
in a C or C++ code file and then ignore those specific files.
A key example of this is at GitHub - scivision/fortran-cpp-interface: Examples of Fortran 2003 C / C++ interfacing with Fortran where I tried to make FPM work by arranging all under “test/” but ran into this problem.
A second problem with this project is I don’t have a “src/” directory because the examples are standalone. I could workaround by putting an empty Fortran module code file under src/.