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. The C++ compiler is not able to compile a simple program / 'sttdef.h' no such file or directory
Forum Updated to NodeBB v4.3 + New Features

The C++ compiler is not able to compile a simple program / 'sttdef.h' no such file or directory

Scheduled Pinned Locked Moved Unsolved Qt Creator and other tools
3 Posts 2 Posters 94 Views 1 Watching
  • 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.
  • B Offline
    B Offline
    barisstark
    wrote last edited by
    #1

    So,when i create a new project i get the The C++ compiler is not able to compile a simple program error like this ;9cc80a7e-d48e-4408-addd-58291d35c8c9-image.png
    So i found a solution to this by simply adding

    set(CMAKE_TRY_COMPILE_TARGET_TYPE "STATIC_LIBRARY")

    before my project name and after that i am getting 'sttdef.h' no such file or directory error after i try to run the project like this;7cc0ea6d-f2f5-4183-b7b8-2ad1a7010ca1-image.png

    My settings;17468854-0534-4b84-b483-d3022922b808-image.png
    f8cbfa22-d6ff-4849-a263-30b3c25c4e6a-image.png

    My visual studio installer settings;
    e2b918b4-d139-4638-b592-a1ebfef53d2a-image.png

    My main purpose is to link OpenCV and make a UI for an engineering project with Qserial.At some point i managed to link OpenCV to Qt but these 2 errors are holding me back for a couple of days now.Any help is appreciated.

    Pl45m4P 1 Reply Last reply
    0
    • B barisstark

      So,when i create a new project i get the The C++ compiler is not able to compile a simple program error like this ;9cc80a7e-d48e-4408-addd-58291d35c8c9-image.png
      So i found a solution to this by simply adding

      set(CMAKE_TRY_COMPILE_TARGET_TYPE "STATIC_LIBRARY")

      before my project name and after that i am getting 'sttdef.h' no such file or directory error after i try to run the project like this;7cc0ea6d-f2f5-4183-b7b8-2ad1a7010ca1-image.png

      My settings;17468854-0534-4b84-b483-d3022922b808-image.png
      f8cbfa22-d6ff-4849-a263-30b3c25c4e6a-image.png

      My visual studio installer settings;
      e2b918b4-d139-4638-b592-a1ebfef53d2a-image.png

      My main purpose is to link OpenCV and make a UI for an engineering project with Qserial.At some point i managed to link OpenCV to Qt but these 2 errors are holding me back for a couple of days now.Any help is appreciated.

      Pl45m4P Offline
      Pl45m4P Offline
      Pl45m4
      wrote last edited by
      #2

      @barisstark said in The C++ compiler is not able to compile a simple program / 'sttdef.h' no such file or directory:

      set(CMAKE_TRY_COMPILE_TARGET_TYPE "STATIC_LIBRARY")

      Why STATIC_LIBRARY if you dont build one?!
      Who told you this? AI?!

      Seems like your kit / build settings aren't correct. Try with default (initial) parameters.


      If debugging is the process of removing software bugs, then programming must be the process of putting them in.

      ~E. W. Dijkstra

      B 1 Reply Last reply
      0
      • Pl45m4P Pl45m4

        @barisstark said in The C++ compiler is not able to compile a simple program / 'sttdef.h' no such file or directory:

        set(CMAKE_TRY_COMPILE_TARGET_TYPE "STATIC_LIBRARY")

        Why STATIC_LIBRARY if you dont build one?!
        Who told you this? AI?!

        Seems like your kit / build settings aren't correct. Try with default (initial) parameters.

        B Offline
        B Offline
        barisstark
        wrote last edited by
        #3

        @Pl45m4 thank you for the reply.

        I have found the set(CMAKE_TRY_COMPILE_TARGET_TYPE "STATIC_LIBRARY") context here.

        and yes using msvc for opencv usage was chatgpt`s suggestion.Im very new to this.

        By initial parameters do you mean mingw and ninja?

        1 Reply Last reply
        0
        • Christian EhrlicherC Christian Ehrlicher moved this topic from General and Desktop

        • Login

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