Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

Qt Creator says "File not found" in issues pane when file exists



  • In Creator (tested 4.6.0 and 4.9.0), in the issues pane during a build that has compile errors, I get a "File not found" in red below the error even though the file exists. It looks like this:

    error: expected a ";"
    File not found: /path/to/existing/main.cpp(21)

    The error, the line # for the error, and the file path are all correct, and the file (main.cpp) is definitely part of the project. It also does not show a red X next to that line in the file.

    I've sort of tracked it down to an include_directories line in the CMakeLists.txt for that project in that if I remove one of the include directories, things seem to start working again (not really proof of a cause, I know). The include line is for the Kokkos project, and in fact I've been using Creator for a decade and have never seen this issue until last week when I started using Kokkos.

    I've tried deleting old project files, copying just the source to a new folder and starting over, and I've tried uninstalling and re-installing several versions of Creator with no success.

    Is there some way I can get more info on the exact command Creator is running that is failing?


  • Lifetime Qt Champion

    Hi and welcome to devnet,

    If everything works nicely with Kokkos, then it's likely coming from that that project.

    How are you integrating it in your project ?



  • This is a Makefile build with CMake. I just have a main.cpp, which looks like this:

    #include <Kokkos_Core.hpp>
    
    using ExecutionSpace = Kokkos::Cuda;
    
    int main( int argc, char* argv[] )
    {
      return 0
    }
    

    To use Kokkos, I stripped everything down to just this CMakeLists.txt:

    project( KokkosTest )
    
    set( CMAKE_CXX_COMPILER mpicxx )
    set( CMAKE_C_COMPILER mpicc )
    
    include_directories(
      /path/to/kokkos/install/include
      /usr/local/cuda/include
    )
    
    add_executable( ${PROJECT_NAME} main.cpp )
    

    I have a kit that has no CMake config so that those compiler settings don't get overridden.

    That kokkos include dir line broke Creator. I then started removing stuff from that Kokkos include dir and found that removing the OpenMP dir solves the issue... or maybe it just moves the compile error to before where the issue would occur. However, Creator is doing some caching of something because when I put that directory back, it doesn't re-break immediately.

    But I don't think this is an issue with Kokkos' build because building from the command line (using make) works fine. Also, if I re-insert that missing semicolon, Creator builds the project successfully. It only has trouble going to the error. No issue with building.



  • I fixed it by adding mpicxx and mpicc as new compilers in "Build and Run" and then setting the "error parser" to clang for both mpicxx and mpicc. Even though both are using GNU -- not Clang -- this seems to fix the issue.


Log in to reply