g++ source.cpp -DQT_SHARED -I/usr/include/qt4 -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtOpenGL -I/usr/include/qt4/QtGui -lQtOpenGL -lQtGui -lQtCore
With pkg-config that becomes:
g++ source.cpp `pkg-config --libs --cflags QtCore QtOpenGL `
Note the use of back-quotes `` to do in-line substitution.
pkg-config can be integrated into eclipse through a pluggin and is also supported by qmake. Just add the following to your .pro file:
CONFIG += link_pkgconfig
PKGCONFIG += name_of_library
No comments:
Post a Comment