Important: Please read the Qt Code of Conduct -

[SOLVED]get a linux terminal compilation command to work with Qt

  • hi,
    i have a file that i want to compile using Qt , because i want to use the debugger .
    i compile the file using :
    g++ ./hello-world.cpp pkg-config --libs --cflags gegl-0.2 -o hello-world

    The output of [quote] pkg-config --libs --cflags gegl-0.2 [/quote] is:

    -pthread -I/usr/include/gegl-0.2 -I/usr/include/babl-0.1 -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -Wl,--export-dynamic -pthread -lgegl-0.2 -lgmodule-2.0 -lgio-2.0 -lbabl-0.1 -lm -lgobject-2.0 -lglib-2.0

    How can i configure Qt to get it to compile the above ?
    I tried in the .pro file to add :
    QMAKE_CXXFLAGS += pkg-config --libs --cflags gegl-0.2
    didn't work .

  • if you have a good reason and need to add custom other libraries then you should check the following:
    @CONFIG += link_pkgconfig
    //did you add link_pkgconfig before using it?@
    if you need to specify exactly where location of those libs are use:
    //also you can use INCLUDEPATH@

    if not! why don't you use the default debug variables like the ones you already get with QMAKE_CXXFLAGS_DEBUG ?
    Why not mention what went wrong like error etc?

  • sorry for not posting the erro .
    but this is the solution (thank you echostorm) :


    QMAKE_CXXFLAGS += pkg-config --libs --cflags gegl-0.2

    LIBS += -pthread -pthread -lgegl-0.2 -lgmodule-2.0 -lgio-2.0 -lbabl-0.1 -lm -lgobject-2.0 -lglib-2.0
    INCLUDEPATH += -I/usr/include/gegl-0.2 -I/usr/include/babl-0.1 -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include

  • 3afwan, your most welcome.

Log in to reply