Results 1 to 2 of 2

Thread: Adding a .pc file in Qt project

  1. #1
    Join Date
    Sep 2020
    Posts
    4
    Qt products
    Qt5
    Platforms
    Unix/X11

    Unhappy Adding a .pc file in Qt project

    Hi i need to add a .pc file in my Qt project.I have done some changes in the .pro file for this :

    PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/home/arun/Documents/Subha/OCT_LIB_WORK/MCPTT_LIB_BUILD_OCT/PJSIP_LIB/lib/pkgconfig/
    #INCLUDEPATH +=/home/arun/Documents/Subha/OCT_LIB_WORK/MCPTT_LIB_BUILD_OCT/PJSIP_LIB/lib/pkgconfig/
    CONFIG += link_pkgconfig
    PKGCONFIG += libpjproject

    pkgconfig.pc is my file to be included. While building , getting the error as 'libpjproject development package not found'. How I'm supposed to link this file to my project.

  2. #2
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: Adding a .pc file in Qt project

    Qt Code:
    1. PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/home/arun/Documents/Subha/OCT_LIB_WORK/MCPTT_LIB_BUILD_OCT/PJSIP_LIB/lib/pkgconfig/
    2. CONFIG += link_pkgconfig
    3. PKGCONFIG += libpjproject
    To copy to clipboard, switch view to plain text mode 

    Problem 1.

    You are asking Qt to run pkg-config and extract the compiler and linker options for a package called "libpjproject". That should be a come from a file called "libpjproject.pc" not "pkgconfig.pc".

    Does this work outside qmake?
    Qt Code:
    1. $ export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/home/arun/Documents/Subha/OCT_LIB_WORK/MCPTT_LIB_BUILD_OCT/PJSIP_LIB/lib/pkgconfig/
    2. $ pkg-config --libs libpjproject
    3. $ pkg-config --cflags libpjproject
    To copy to clipboard, switch view to plain text mode 

    Problem 2.
    PKG_CONFIG_PATH is not an qmake variable, it is an environment variable that pkg-config might use, This needs to set outside qmake.

Similar Threads

  1. Replies: 3
    Last Post: 20th September 2016, 18:29
  2. Replies: 0
    Last Post: 17th September 2015, 22:03
  3. Replies: 22
    Last Post: 1st February 2012, 22:56
  4. Replies: 1
    Last Post: 4th December 2009, 00:34
  5. adding a qt-ui to a non-qt project, dll
    By TheKedge in forum Qt Programming
    Replies: 3
    Last Post: 28th February 2007, 18:08

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.