简体   繁体   中英

How to install pkg-config correctly?

When I tried installing pkg-config, I got this error:

configure: error: Either a previously installed pkg-config or "glib-2.0 >= 2.16" could not be found. Please set GLIB_CFLAGS and GLIB_LIBS to the correct values or pass --with-internal-glib to configure to use the bundled copy.

And then when I included --with-internal-glib next to ./configure , I get this error:

configure: error: *** No iconv() implementation found in C library or libiconv configure: error: ./configure failed for glib

What do these errors mean?

Use cygcheck -p to find the package to add to your Cygwin installation that your code is looking for:

$ cygcheck -p usr/lib/libiconv
Found 7 matches for usr/lib/libiconv
...
libiconv-devel-1.16-2 - libiconv-devel: Unicode iconv() implementation
libiconv-1.14-2 - libiconv: Unicode iconv() implementation (installed binaries and support files)

You need to install the libiconv-devel package that will provide the headers and the import libraries. After installation you will have:

 $ cygcheck -l libiconv-devel |grep "a$"
/usr/lib/libcharset.a
/usr/lib/libcharset.dll.a
/usr/lib/libiconv.a
/usr/lib/libiconv.dll.a

you can also see if the available glib (libglib2.0-devel) is suitable for your build

$ cygcheck -p usr/lib/libglib
Found 10 matches for usr/lib/libglib
glib2.0-debuginfo-2.50.3-1 - glib2.0-debuginfo: Debug info for glib2.0
...
libglib2.0-devel-2.54.3-1 - libglib2.0-devel: GNOME core C function library (development)
...
libglibmm2.4-devel-2.54.1-2 - libglibmm2.4-devel: C++ bindings for glib-2.4 (development)

Do not forget to install also cygwin-devel

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM