Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Setting OpenGl in plain C project
Forum Updated to NodeBB v4.3 + New Features

Setting OpenGl in plain C project

Scheduled Pinned Locked Moved Unsolved General and Desktop
5 Posts 2 Posters 1.0k 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.
  • meguliM Offline
    meguliM Offline
    meguli
    wrote on last edited by
    #1

    I am trying to set up OpenGl Project in QtCreator but as plain C project. I am using Qt application and its OpenGl capabilities normally but I wanted to try qtcreator as a C ide. So far I like it but I could not setup OpenGl. For some reason, I can't make it see glu.h.
    I am using MSVC 2012 kit on Windows and I wrote a quick just-open-window with SDL application. I was able to run it on Linux. Here is relevant portion of my .pro file regarding this;

    INCLUDEPATH += $$WINDOWSSDKDIR/../8.1/include/um/gl
    DEPENDPATH += $$WINDOWSSDKDIR/../8.1/include/um/gl
    

    Windows ships with glu.h in this directory. Also in my local include directory, I have GL folder that contains glew.h. This is how I always work with Visual Studio but Visual Studio just sees GL and glu since it's part of Windows SDK. What should I do to make this work on plain C project?

    1 Reply Last reply
    0
    • meguliM Offline
      meguliM Offline
      meguli
      wrote on last edited by
      #2

      To solve this, I went to Projects -> Build Environment and added above paths to LIB and INCLUDE respectively. I thought writing them to .pro file would suffice.

      1 Reply Last reply
      1
      • SGaistS Offline
        SGaistS Offline
        SGaist
        Lifetime Qt Champion
        wrote on last edited by
        #3

        Hi and welcome to devnet,

        Are you sure that WINDOWSSDKDIR is containing the right path ?

        Interested in AI ? www.idiap.ch
        Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

        meguliM 1 Reply Last reply
        0
        • SGaistS SGaist

          Hi and welcome to devnet,

          Are you sure that WINDOWSSDKDIR is containing the right path ?

          meguliM Offline
          meguliM Offline
          meguli
          wrote on last edited by meguli
          #4

          @SGaist $WINDOWSSDKDIR points to c:\Program Files x86\Windows Kits 8.0. I have two other folders here; 8.1 and 10 and gl headers are in 8.1. Thats why I added above includes. And I fixed the problem, adding those dirs to Build Environment by hand.

          1 Reply Last reply
          0
          • SGaistS Offline
            SGaistS Offline
            SGaist
            Lifetime Qt Champion
            wrote on last edited by
            #5

            What errors did you had ?

            Interested in AI ? www.idiap.ch
            Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

            1 Reply Last reply
            0

            • Login

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