Important: Please read the Qt Code of Conduct -

'omp.h' file not found

  • Hello everyone,
    I'm having an issue with OpenMP in Qt Creator. Annotations say it can not find omp.h and then all functions it defines are not recognized. However it builds correctly and F2 navigates to the file /usr/lib/gcc/x86_64-linux-gnu/7/include/omp.h
    My setup is:

    • Linux Mint 19 Tara
    • Qt Creator 4.11.0
    • Desktop Qt 5.12.6 GCC 64bit kit
    • g++ (Ubuntu 7.4.0-1ubuntu1~18.04.1) 7.4.0

    It worked few days ago, so it may depend on some recent OS update. Does anyone have a solution for this issue?

  • Qt Champions 2017

    That's probably the code model. You can either disable the annotations (i.e. disabling the clang code model) or provide additional includes to the relevant file - that's the button top left in the file edit, the one that says # is for giving additional preprocessor directives for the code parsing.

  • Thank you @kshegunov for your reply. It's not proposing any additional file to be included. It's

    #include <omp.h>

    itself to fail with "file not found".
    Can you try to create a plain C++ project and just include omp.h? Just to know if this only affects me and if it could make sense to reinstall Qt Creator.

  • Qt Champions 2017

    I don't think reinstalling Creator should fix it. As I said I believe it's just the code model that doesn't find the header, as you reported the project builds fine. That's why I suggested fiddling with its flags to make it understand where that's located.

Log in to reply