Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt Creator and other tools
  4. Qt Creator can't find include headers
Forum Update on Monday, May 27th 2025

Qt Creator can't find include headers

Scheduled Pinned Locked Moved Unsolved Qt Creator and other tools
4 Posts 2 Posters 6.9k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    maydin
    wrote on last edited by
    #1

    I just opened a .C file without creating a project and Qt Creator says "stdio.h: No such file or directory" for

    #include <stdio.h>
    

    If I create a project there is no problem but when I want to just edit a .C file, program can't find the headers.

    I'm using Xubuntu 15.10 and Qt 5.7.0 GCC 64Bit kit.

    K 1 Reply Last reply
    0
    • M maydin

      I just opened a .C file without creating a project and Qt Creator says "stdio.h: No such file or directory" for

      #include <stdio.h>
      

      If I create a project there is no problem but when I want to just edit a .C file, program can't find the headers.

      I'm using Xubuntu 15.10 and Qt 5.7.0 GCC 64Bit kit.

      K Offline
      K Offline
      koahnig
      wrote on last edited by
      #2

      @maydin

      How did you open a file and when are you getting the error message?

      You are required to include a .C file into a project for running the compiler. Therefore, without opening and including or creating a project you cannot compile.

      If I understand you correctly, every thing is fine since you can compile without error message when including the .C file into a project.

      Qt creator is just an IDE. It allows editing and starting processes like compiling and linking. In order to achieve this it is required to use some other tools (e.g. compiler), but also some Qt tools such as qmake. qmake requires a proper .pro file and will create a make file, which supports the compilation. Anything missing the chain will result in a failure.

      Vote the answer(s) that helped you to solve your issue(s)

      1 Reply Last reply
      1
      • M Offline
        M Offline
        maydin
        wrote on last edited by maydin
        #3

        In file manager I just did "Open file with 'Qt Creator'". It is just a simple C file. I don't want to compile it via Qt Creator. I just want to edit my code. Because of this problem, I can't use code hinting etc. I will compile it using gcc in terminal later.

        As you can see this doesn't belong to a project, therefore there is no .pro file.
        alt text

        K 1 Reply Last reply
        0
        • M maydin

          In file manager I just did "Open file with 'Qt Creator'". It is just a simple C file. I don't want to compile it via Qt Creator. I just want to edit my code. Because of this problem, I can't use code hinting etc. I will compile it using gcc in terminal later.

          As you can see this doesn't belong to a project, therefore there is no .pro file.
          alt text

          K Offline
          K Offline
          koahnig
          wrote on last edited by
          #4

          @maydin

          AFAIK the include path definition is missing. Without project creator does not know how you plan to compile it later on. Therefore, some of the hinting is missing.

          The background is that Qt creator is an IDE where you can easily change between different tool chains. E.g. you can use an old compiler version and do the compilation and at next you may use a newer compiler version and compile the same code. Not sure what an alternative for gcc would be on linux, but on windows, you can use with one compile run MinGW (gcc derivate) and with some clicks you change everything and do a compile with the microsoft compiler.

          All this is defined through so-called kits. Changing a kit to another do also change the hinting and stuff. However, you have no kit defined therefore creator does not know how and what to "hint".

          Certainly you can use creator as pure editor, but that provides some hick-ups with reduced support (e.g. hinting).

          For your case you can add a project file for defining the requried and do the compilation from a terminal lateron. However, you miss out quite a lot of stuff helping you otherwise.

          Vote the answer(s) that helped you to solve your issue(s)

          1 Reply Last reply
          2

          • Login

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved