How to compile OpenGL code using QT Creator on Ununtu 64 bit?



  • Hi.

    I need to compile OpenGL code written in C++ on QT Creator but I do not know that I have added libraries required correctly: X11 and GL..

    Ah, I am on Ubuntu Linux 64bit 12.04LTS.

    When I compile, it shows a following Error
    @:-1: error: [Makefile] Error 3@

    My opengl c++ source code compiled and worked fine on Code Blocks IDE once after I simply added X11 and GL library.. but it seem it do not work same on QT Creator IDE...

    How to fix it??

    Here is .pro file:
    @
    TEMPLATE = app
    CONFIG += console

    CONFIG -= app_bundle
    CONFIG -= qt

    SOURCES += main.cpp

    unix: CONFIG += link_pkgconfig
    unix: PKGCONFIG += X11

    unix: CONFIG += link_pkgconfig
    unix: PKGCONFIG += GL
    @

    Here is downloadable address of Cpp source code:
    http://cfile225.uf.daum.net/attach/2222E53452156ACD2115EA


  • Lifetime Qt Champion

    Hi and welcome to devnet,

    Could you post the rest of the error ?

    There's no need for several CONFIG += link_pkgconfig lines one is enough.

    Also, are you sure that X11 and GL are the right name to give to link_pkgconfig ?



  • hi.this pro work perfectly on 64 archlinux with qt 5.1.0
    @
    TEMPLATE = app
    CONFIG += console opengl x11
    CONFIG -= qt
    SOURCES += main.cpp
    @


Log in to reply
 

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