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 - Linking in 2.6.0

Qt Creator - Linking in 2.6.0

Scheduled Pinned Locked Moved Qt Creator and other tools
8 Posts 2 Posters 4.7k 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.
  • K Offline
    K Offline
    kantaki
    wrote on last edited by
    #1

    Hello,

    I am unable to add any library. Currently I want to use glfw in qtcreator. Its compiled under mingw.

    I added the following lines in the .pro file

    @INCLUDEPATH += C:/glfw/include
    LIBS += -LC:/glfw/lib-mingw@

    But when I compile the glfw hello world program I get tons of different undefined reference errors. So I guess the linking didn't work. Where is the mistake?

    1 Reply Last reply
    0
    • K Offline
      K Offline
      koahnig
      wrote on last edited by
      #2

      One thing for sure the LIBS declaration is not complete. Checkout "qmake-libs":http://qt-project.org/doc/qt-4.8/qmake-variable-reference.html#libs You have only the path declaration with the capital 'L'. You need to specify also the lib itself with lower case 'l'.

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

      1 Reply Last reply
      0
      • K Offline
        K Offline
        kantaki
        wrote on last edited by
        #3

        I tried now this

        @INCLUDEPATH += C:/glfw/include
        LIBS += -LC:/glfw/lib -lglfw@

        but I still get the same undefined reference errors. :(

        1 Reply Last reply
        0
        • K Offline
          K Offline
          koahnig
          wrote on last edited by
          #4

          You should post the error messages then.

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

          1 Reply Last reply
          0
          • K Offline
            K Offline
            kantaki
            wrote on last edited by
            #5

            for this program
            @
            #include <GL/gl.h>
            #include <GL/glfw.h>

            #include <stdlib.h>
            int main()
            {
            if(glfwInit())
            {
            return 0;
            }
            return 0;
            }@

            error: undefined reference to `glfwInit'

            error: collect2: ld returned 1 exit status

            1 Reply Last reply
            0
            • K Offline
              K Offline
              koahnig
              wrote on last edited by
              #6

              Where is the library placed? Provide path and name of lib.
              Note, you changed the path to the lib between your first and second post.

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

              1 Reply Last reply
              0
              • K Offline
                K Offline
                kantaki
                wrote on last edited by
                #7

                yes i changed the name of the lib folder because I thought the hyphen maybe causes trouble.

                the lib is located at C:/glfw
                include /
                GL/
                glfw.h


                lib/
                glfw.dll
                libglfw.a
                libglfwdll.a

                1 Reply Last reply
                0
                • K Offline
                  K Offline
                  koahnig
                  wrote on last edited by
                  #8

                  The only things I would try is to make sure that:

                  • qmake was run after changes to .pro.
                  • Making sure that the same MinGW version was used for compilation of the lib and the my code.
                  • Since the project is still rather small, you can easily do a complete rebuild.
                  • It looks like there is only a release version of the lib available. AFAIK you may mix debug and release version, but I do not myself. So I would try to avoid.

                  Otherwise I am lost here.

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

                  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