Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. [SOLVED]get a linux terminal compilation command to work with Qt
Forum Updated to NodeBB v4.3 + New Features

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

Scheduled Pinned Locked Moved General and Desktop
4 Posts 2 Posters 1.2k Views 1 Watching
  • 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.
  • S Offline
    S Offline
    saeedhardan
    wrote on 15 Oct 2014, 19:58 last edited by
    #1

    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 .

    1 Reply Last reply
    0
    • E Offline
      E Offline
      echostorm
      wrote on 15 Oct 2014, 20:53 last edited by
      #2

      if you have a good reason and need to add custom other libraries then you should check the following:
      @CONFIG += link_pkgconfig
      PKGCONFIG += ADD YOUR LIBRARIES HERE
      //did you add link_pkgconfig before using it?@
      if you need to specify exactly where location of those libs are use:
      @LIBS += ADD YOUR LOCATIONS HERE
      //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?

      1 Reply Last reply
      0
      • S Offline
        S Offline
        saeedhardan
        wrote on 16 Oct 2014, 05:13 last edited by
        #3

        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
        @

        1 Reply Last reply
        0
        • E Offline
          E Offline
          echostorm
          wrote on 16 Oct 2014, 05:24 last edited by
          #4

          3afwan, your most welcome.

          1 Reply Last reply
          0

          1/4

          15 Oct 2014, 19:58

          • Login

          • Login or register to search.
          1 out of 4
          • First post
            1/4
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved