Find the answer to your Linux question:
Results 1 to 1 of 1
Hi! After years of benefiting from others' Q&A, I have finally joined this site. This is my first posting here. Thank you! The terminal output below speaks for itself to ...
  1. #1
    Just Joined!
    Join Date
    Feb 2010
    Posts
    2

    pkg-config quirk

    Hi!
    After years of benefiting from others' Q&A, I have finally joined this site. This is my first posting here. Thank you!

    The terminal output below speaks for itself to the informed. Or read following paragraph for descriptive explanation.

    Recently, in the development of a glib app - a GIMP plug-in actually - I wrote a simple main.c tester using ANSI C. So, the object code apparently compiled just fine with glib-2.0 options; however, when I went to link-and-compile with the main.c code, the compiler referred to "undefined function: sqrt()" which I used in the glib code, but not the main.c. I found the culprit: missing '-L/usr/lib' and '-lm' - which I added manually. So, I took a look at the file "/usr/lib/pkgconfig/glib-2.0". I see the missing '-lm'. But, I cannot figure out why '-L/usr/lib' is missing!?


    /~:> pkg-config --version
    0.22

    /~:> cat /usr/lib/pkgconfig/glib-2.0.pc
    prefix=/usr
    exec_prefix=${prefix}
    libdir=${exec_prefix}/lib
    includedir=${prefix}/include

    glib_genmarshal=glib-genmarshal
    gobject_query=gobject-query
    glib_mkenums=glib-mkenums

    Name: GLib
    Description: C Utility Library
    Version: 2.20.1
    Libs: -L${libdir} -lglib-2.0
    Libs.private:
    Cflags: -I${includedir}/glib-2.0 -I${libdir}/glib-2.0/include

    /~:> echo `pkg-config --cflags --libs glib-2.0`
    -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -lglib-2.0

    /~:>


    -R
    Last edited by Balthazar; 02-18-2010 at 09:33 AM. Reason: Color - ease of reading

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...