Нужно установить pkg-config, но дело в том что я не знаю как.
-
Вопрос задан
-
1905 просмотров
Комментировать
Подписаться
1
Оценить
Комментировать
Пригласить эксперта
Ответы на вопрос 1
Если windows 64bit, то проще всего используя conda
conda install -c conda-forge pkg-config
либо используя chocolatey
choco install pkgconfiglite
Комментировать
Ваш ответ на вопрос
Войдите, чтобы написать ответ
Похожие вопросы
-
Показать ещё
Загружается…
Минуточку внимания
Реклама
Provide feedback
Saved searches
Use saved searches to filter your results more quickly
Sign up
- Can I install pkg on Windows?
- What is pkg-config in Windows?
- Where do I put pkg-config files?
- What is pkg-config path?
- What is a package file?
- What is CMake pkg-config?
- What is pkg-config — Cflags?
- What is Pkg_check_modules?
- What is a package config file?
- What is .pc file Linux?
- What is pkg-config Ubuntu?
- What is PKG_CONFIG_PATH environment variable?
- How do I open a PKG file?
- Why is Mac installer not working?
Can I install pkg on Windows?
pkg files is created with the makesis command, which is a part of the CreateSIS utility program. Nevertheless, . pkg files cannot be open directly on your Windows 10 system, which means you would need to have a file utility software installed to have access to this file format.
What is pkg-config in Windows?
pkg-config is a helper tool used when compiling applications and libraries. … pkg-config works on multiple platforms: Linux and other UNIX-like operating systems, Mac OS X and Windows. It does not require anything but a reasonably well working C compiler and a C library, but can use an installed glib if that is present.
Where do I put pkg-config files?
pc file, it MUST be installed in $(DESTDIR)$(libdir)/pkgconfig. The user of your package has the privilege and the responsibility of setting DESTDIR and libdir appropriately, and if your package ignores what the user specifies then your package is broken.
What is pkg-config path?
pkg-config is a useful tool for making sure compiler options are correct when compiling and linking software. Very often with compilers, you will need to determine the proper paths to library header files and code in order to link them to your software project. … pkg-config is designed to assist with that.
What is a package file?
A package file is a file format used in Apple computers (macOS). … While package files appear to be a single file when viewed on an Apple computer, they actually contain many other files and are represented as a folder on non-Apple computers and most web browsers.
What is CMake pkg-config?
A pkg-config module for CMake. … A list of arguments to pass to pkg-config. Both PKG_CONFIG_EXECUTABLE and PKG_CONFIG_ARGN are initialized by the module, but may be overridden by the user. See Variables Affecting Behavior for how these variables are initialized.
What is pkg-config — Cflags?
—cflags means the pkg-config should give the compilation flags for the listed packages. —libs means the pkg-config should give the linking information for the listed packages. and dbus-1 is the name of the package.
What is Pkg_check_modules?
a pkg-config module for CMake. Usage: pkg_check_modules(<PREFIX> [REQUIRED] [QUIET] <MODULE> [<MODULE>]*) checks for all the given modules. pkg_search_module(<PREFIX> [REQUIRED] [QUIET] <MODULE> [<MODULE>]*) checks for given modules and uses the first working one.
What is a package config file?
The packages. config file is used in some project types to maintain the list of packages referenced by the project. This allows NuGet to easily restore the project’s dependencies when the project is to be transported to a different machine, such as a build server, without all those packages.
What is .pc file Linux?
DESCRIPTION. pkg-config files provide a useful mechanism for storing various information about libraries and packages on a given system. Information stored by . pc files include compiler and linker flags necessary to use a given library, as well as any other relevant metadata. These .
What is pkg-config Ubuntu?
DESCRIPTION. The pkg-config program is used to retrieve information about installed libraries in the system. It is typically used to compile and link against one or more libraries.
What is PKG_CONFIG_PATH environment variable?
PKG_CONFIG_PATH is a environment variable that specifies additional paths in which pkg-config will search for its . pc files. This variable is used to augment pkg-config’s default search path. On a typical Unix system, it will search in the directories /usr/lib/pkgconfig and /usr/share/pkgconfig .
How do I open a PKG file?
Since PKG files are saved in plain text, they can be opened and modified with a text editor, such as Microsoft Notepad or Apple TextEdit, which are bundled with Windows and macOS. If you cannot open the PKG file with a text editor, you most likely have a different type of PKG file.
Why is Mac installer not working?
The first option around this is to ‘force quit’ the installer. Press Apple-option-esc then select ‘Software Update’ and ‘Force Quit’. If that doesn’t work try deleting the following 2 files from your Library/LaunchDaemons.
Background and Issues
In the process of C++ project development, some of these dependencies may be directly introduced into their own projects in the form of git submodule source code for static link, and sometimes want to control the size of the compilation product, some of the more common dependencies hope to rely on the form of dynamic link. Like libpng, libwebp, or harfbuzz.
/usr/local/include/lib/lib/lib/lib/lib/lib/lib/lib/lib/lib/lib/lib/lib/lib/lib/lib/lib/lib However, because the libraries installed on different systems may not be in the same directory, compilation and configuration is difficult to perform across platforms.
We can use pkg-config to help us solve this problem. When we need to rely on an external library, we can have pkg-config tell us what the compile link command should be in order to rely on it in the current environment. Let’s see how this is applied.
Install the PKG – config
Pkg-config was originally developed for Linux, but is currently cross-platform and supports Mac, Linux, and Windows. If you don’t already have pkg-config in your environment, install it first:
# macos
brew install pkg-config
# ubuntu
apt-get install pkg-config
# Other platforms trust you to find a way
Copy the code
Start using pkg-config
Pkg-config is itself a command line tool, we can try to print a compilation option such as libwebp in the current environment:
pkg-config libwebp --cflags
Copy the code
The output in my environment is:
-I/usr/local/ Cellar/webp / 1.2.0 / includeCopy the code
Try printing libwebp’s link options again:
pkg-config libwebp --libs
Copy the code
The output in my environment is:
-L/usr/local/ Cellar/webp / 1.2.0 / lib - lwebpCopy the code
You can specify multiple options for pkg-config to be printed together, such as cflags and libs options:
pkg-config libwebp --libs --cflags
Copy the code
The output is:
-I/usr/local/ Cellar/webp / 1.2.0 / include - L/usr /local/ Cellar/webp / 1.2.0 / lib - lwebpCopy the code
You can even specify multiple external libraries in a single command, like when I specify libwebp and libpng at the same time:
pkg-config libwebp libpng --libs --cflags
Copy the code
The output of the test is:
-I/usr/local/ Cellar/webp / 1.2.0 / include - I/usr /local/ Cellar/libpng / 1.6.37 / / usr/include/libpng16 - Llocal/ Cellar/webp / 1.2.0 / / usr/lib - Llocal/ Cellar/libpng / 1.6.37 / lib - lwebp - lpng16 - lzCopy the code
You can see that its output can be applied directly to the compiler, so it can be combined with the compiler directly on the command line:
gcc -o test test.c `pkg-config --libs --cflags libwebp`
Copy the code
You can even use pkg-config to check the version number of the external library in the current environment:
pkg-config libwebp --version
Copy the code
The command parameters can be referenced to the output of –help.
Use pkg-config in CMake
Of course, general formal projects will use meta-build tools to generate cross-platform project compilation configuration, I use CMake, in CMake can also be very convenient to use pkG-config:
find_package(PkgConfig REQUIRED)
if (PKG_CONFIG_FOUND)
pkg_check_modules(my_deps REQUIRED IMPORTED_TARGET libpng libwebp)
endif(a)Copy the code
First use CMake’s find_package mechanism to find the local pkG-config. If successful, there are two ways to find the external library:
- Pkg_check_modules: Based on the external libraries given in the list, try to find them in the current environment
- Pkg_search_module: Finds the first successfully found external library in the list
You can use pkg_check_modules as required, most of the time using pkg_check_modules. The first parameter is a match prefix, which allows you to consume the result once you need to rely on multiple external libraries. You can also specify REQUIRED to indicate that the dependency is REQUIRED for this build, or fail to terminate the build. The result of applying pkg-config is then consumed in the CMake context using PkgConfig::${prefix} as the target_link_libraries parameter:
target_link_libraries(${PROJECT_NAME} PkgConfig::my_deps)
Copy the code
If your CMake version is less than 3.6, you can also use the following variables:
- _LDFLAGS
- _CFLAGS
For more details on using PKg-config in CMake, you can refer to its official documentation: cmake.org/cmake/help/… .
How does pkg-config find dependencies
What if we asked PKg-config to look for an external library that was not installed?
pkg-config libxxx --cflags
Copy the code
Will output:
Package libxxxx was not found in the pkg-config search path.
Perhaps you should add the directory containing `libxxxx.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libxxxx' found
Copy the code
Pkg-config is used to determine the result of the search by reading the directory of the PC file. This directory is usually libdir/pkgconfig. If your libwebp is installed in /usr/local/lib/pkgconfig, then the PC file is libwebp. PC under /usr/local/lib/pkgconfig. A PC file is a plain text file. Let’s take a look at the contents of a PC file:
The prefix = / usr/local/Cellar/webp 1.2.0 exec_prefix = ${prefix} libdir = ${exec_prefix} / lib includedir = ${prefix} / include Name: Libwebp Description: Library for the WebP graphics format Version: 1.2.0 Cflags: -i ${includedir} Libs: -L${libdir} -lwebp Libs.private: -lm -D_THREAD_SAFE -pthreadCopy the code
You can see that the file defines the dependency name, version number, directory prefix in the current environment, compile options, and so on, and you can see where the pkg-config output comes from.
External dependencies may also have dependencies between external dependencies. Pkg-config will help you resolve this dependency problem. In fact, library dependencies are also defined in PC files.
The prefix = / usr/local/Cellar/harfbuzz 2.8.0 _1 libdir = ${prefix} / lib includedir = ${prefix} / include Name: harfbuzz Description: HarfBuzz text Shaping Library Version: 2.8.0 Requires. Private: Freetype2, Graphite2, glib-2.0 Libs: -L${libdir} -lharfbuzz Libs.private: -lm -framework ApplicationServices Cflags: -I${includedir}/harfbuzzCopy the code
The library also relies on freetype2, graphite2, and glib-2.0 libraries. As long as the PC file Requires or Requires. Cflags or LIbs output will also have dependent compilation options:
-I/usr/local/ Cellar/harfbuzz / 2.8.0 _1 / include/harfbuzz - I/usr /local/opt/freetype/include/freetype2 -I/usr/local/ Cellar/graphite2/1.3.14 / include - I/usr /local/ Cellar/glib / 2.68.1 / include/glib - 2.0 - I/usr /local/ Cellar/glib / 2.68.1 / lib/glib - 2.0 / include - I/usr /local/opt/gettext/include -I/usr/local/ Cellar/pcre / 8.44 / includeCopy the code
Usually one LIB corresponds to one PC file, but sometimes projects with multiple libs will define multiple PC files, such as FFmPEG:
- libavcodec.pc
- libavdevice.pc
- libavfilter.pc
- libavformat.pc
- libavutil.pc
Pkg-config Searches for path configuration
Pkgconfig: /usr/lib/pkgconfig: /usr/share/pkgconfig: /usr/lib/pkgconfig: /usr/share/pkgconfig: /usr/lib/pkgconfig An additional pkg-config lookup path can be specified using the environment variable PKG_CONFIG_PATH, for example:
export PKG_CONFIG_PATH="/usr/local/opt/icu4c/lib/pkgconfig:${PKG_CONFIG_PATH}"
export PKG_CONFIG_PATH="/usr/local/opt/jpeg-turbo/lib/pkgconfig:${PKG_CONFIG_PATH}"
Copy the code
Generating A PC file
At present, most well-known libraries should have PC files. If your dependency does not have PC files, you can write PC files for it. However, it is not difficult to find that if you write PC files manually, then the path in the file is still the absolute path bound to the current environment, so the problem is not solved. Using Autotools to generate PC files automatically is the correct posture in most cases. Here’s how to use Autotools to generate PC files. First you need to define pc.in files as templates in your projects, such as the pc.in files for libwebp projects:
prefix=@prefix@
exec_prefix=@exec_prefix@
libdir=@libdir@
includedir=@includedir@
Name: libwebp
Description: Library for the WebP graphics format
Version: @PACKAGE_VERSION@
Cflags: -I${includedir}
Libs: -L${libdir} -lwebp
Libs.private: -lm @PTHREAD_CFLAGS@ @PTHREAD_LIBS@
Copy the code
Where @variable@ is a variable that will be replaced by configure. The next step is to add the PC files in the configur. Ac file via AC_CONFIG_FILES, and then when the library is installed, after setting the variables correctly through configure, the PC files are dynamically generated and installed in the appropriate locations along with the rest of the library files.
The last
Pkg-config basically solves the problem that cross-platform compilation is a three-party library dependent compilation and configuration, and it is simple to use. It can be easily combined with the command line or many meta-building tools. Pkg-config is not, of course, a package management tool, and although most well-known libraries have PC files, it is sometimes necessary to configure the correct lookup path for PKg-config in a particular environment. If you define your own library that needs to be happily relied upon by other projects, then use the tools to generate PC files yourself.
This is the Windows app named pkg-config-lite whose latest release can be downloaded as pkg-config-lite-0.28-1_bin-win32.zip. It can be run online in the free hosting provider OnWorks for workstations.
Download and run online this app named pkg-config-lite with OnWorks for free.
Follow these instructions in order to run this app:
— 1. Downloaded this application in your PC.
— 2. Enter in our file manager https://www.onworks.net/myfiles.php?username=XXXXX with the username that you want.
— 3. Upload this application in such filemanager.
— 4. Start any OS OnWorks online emulator from this website, but better Windows online emulator.
— 5. From the OnWorks Windows OS you have just started, goto our file manager https://www.onworks.net/myfiles.php?username=XXXXX with the username that you want.
— 6. Download the application and install it.
— 7. Download Wine from your Linux distributions software repositories. Once installed, you can then double-click the app to run them with Wine. You can also try PlayOnLinux, a fancy interface over Wine that will help you install popular Windows programs and games.
Wine is a way to run Windows software on Linux, but with no Windows required. Wine is an open-source Windows compatibility layer that can run Windows programs directly on any Linux desktop. Essentially, Wine is trying to re-implement enough of Windows from scratch so that it can run all those Windows applications without actually needing Windows.
pkg-config-lite
DESCRIPTION
pkg-config-lite is based on pkg-config, but is built with a glib code snippet which eliminates the glib dependency, so it is possible once again to build and run pkg-config without dependencies.
Version: 0.28-1 (based on pkg-config-0.28)
Features
- Otherwise identical with pkg-config (same code base & version number)
Audience
Developers
User interface
Command-line
Programming Language
C
This is an application that can also be fetched from https://sourceforge.net/projects/pkgconfiglite/. It has been hosted in OnWorks in order to be run online in an easiest way from one of our free Operative Systems.
Download Windows & Linux apps
- Linux apps
- Windows apps
-
1
- JasperReports Library
- JasperReports Library is the
world’s most popular open source
business intelligence and reporting
engine. It is entirely written in Java
and it is able to … - Download JasperReports Library
-
2
- Frappe Books
- Frappe Books is a free and open source
desktop book-keeping software that’s
simple and well-designed to be used by
small businesses and freelancers. It’… - Download Frappe Books
-
3
- Numerical Python
- NEWS: NumPy 1.11.2 is the last release
that will be made on sourceforge. Wheels
for Windows, Mac, and Linux as well as
archived source distributions can be fou… - Download Numerical Python
-
4
- CMU Sphinx
- CMUSphinx is a speaker-independent large
vocabulary continuous speech recognizer
released under BSD style license. It is
also a collection of open source tools … - Download CMU Sphinx
-
5
- PyScripter
- PyScripter is an open-source Python
Integrated Development Environment (IDE)
created with the ambition to become
competitive in functionality with
commercial I… - Download PyScripter
-
6
- Old Feren OS Repositories
- This was the Official Repository for
Feren OS. To add the latest one, run
this command: (16.04-based) echo
«deb … - Download Old Feren OS Repositories
- More »
Linux commands
-
1
- aarch64-linux-gnu-strip
- strip — Discard symbols from object
files. … - Run aarch64-linux-gnu-strip
-
2
- aasavefont
- aafire, aainfo, aasavefont, aatest —
aalib example programs … - Run aasavefont
-
3
- cps-auth
- cps-auth — Perform OAuth2
authentication for cloudprint-service … - Run cps-auth
-
4
- cpuburn
- cpuburn, burnBX, burnK6, burnK7,
burnMMX, burnP5, burnP6 — a collection
of programs to put heavy load on CPU … - Run cpuburn
-
5
- gbklatex
- bg5latex — Use LaTeX directly on a Big5
encodedtex file bg5pdflatex — Use
pdfLaTeX directly on a Big5 encodedtex
file bg5+latex — Use LaTeX directly on a
Big5+… - Run gbklatex
-
6
- gbkpdflatex
- bg5latex — Use LaTeX directly on a Big5
encodedtex file bg5pdflatex — Use
pdfLaTeX directly on a Big5 encodedtex
file bg5+latex — Use LaTeX directly on a
Big5+… - Run gbkpdflatex
- More »