Qt creator Adding external library (still: Cannot open include file: 'GL/glew.h')



  • I followed the instruction:

    In the Projects pane, open the project file (.pro).
    Right-click in the code editor to open the context menu and select Add Library....
    !http://www.qtcentre.org/attachment.php?attachmentid=8687&d=1360207416(Add Library)!

    Then the following lines were added into the pro file:

    win32:CONFIG(release, debug|release): LIBS += -L$$PWD/D:/OpenGL/glew-1.5.4/lib/ -lglew32
    else:win32:CONFIG(debug, debug|release): LIBS += -L$$PWD/D:/OpenGL/glew-1.5.4/lib/ -lglew32d

    INCLUDEPATH += $$PWD/D:/OpenGL/glew-1.5.4/include
    DEPENDPATH += $$PWD/D:/OpenGL/glew-1.5.4/include

    However, I click the green triangle icon on the bottom left the run the program, still get the errors:

    error: C1083: Cannot open include file: 'GL/glew.h': No such file or directory

    Why? Thanks in advance



  • This path makes no sense;
    $$PWD/D:/OpenGL/glew-1.5.4/include

    The $$PWD expands to the place where your .pro file lives. Appending a full path to that can not give you a proper path.



  • Thanks,

    I changed it to D:/OpenGL/glew-1.5.4/include, but the errors are the same



  • try run qmake and then compile



  • This is how I did, but I work in Linux, hope it helps you:

    @INCLUDEPATH += /usr/lib
    DEPENDPATH += /usr/lib

    INCLUDEPATH += /APPS/datared/bin/cgal/include
    DEPENDPATH += /APPS/datared/bin/cgal/include

    INCLUDEPATH += /APPS/datared/bin/cgal/include/CGAL/config/x86-64_Linux-2.6_g++-3.4.6

    LIBS += -L/usr/lib64 -lboost_thread

    LIBS += -L/APPS/datared/bin/cgal/lib/x86-64_Linux-2.6_g++-3.4.6 -lCGAL@

    Regards.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.