⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 pkg-config.1

📁 windows平台下开发gtk程序所需要的库和头文件等
💻 1
📖 第 1 页 / 共 2 页
字号:
.\" .\" pkg-config manual page..\" (C) Red Hat, Inc. based on gnome-config man page (C) Miguel de Icaza (miguel@gnu.org).\"..\" Macros to disable groff line adjustment warnings that we can't easily.\" fix in the text..ie \n(.g \{\.  de DW.    nr .oldwarn \n[.warn].    warn 0.  ..  de EW.    warn \n[.oldwarn].  ..\}.el \.\{ \.  de DW.  ..  de EW.  ..\}..TH pkg-config 1.SH NAMEpkg-config \- Return metainformation about installed libraries.SH SYNOPSIS.PP.B pkg-config[\-\-modversion] [\-\-help] [\-\-print-errors] [\-\-silence-errors] [\-\-cflags] [\-\-libs] [\-\-libs-only-L][\-\-libs-only-l] [\-\-cflags-only-I][\-\-variable=VARIABLENAME][\-\-define-variable=VARIABLENAME=VARIABLEVALUE][\-\-uninstalled][\-\-exists] [\-\-atleast-version=VERSION] [\-\-exact-version=VERSION][\-\-max-version=VERSION] [LIBRARIES...].SH DESCRIPTIONThe \fIpkg-config\fP program is used to retrieve information aboutinstalled libraries in the system.  It is typically used to compileand link against one or more libraries.  Here is a typical usagescenario in a Makefile:.PP.nfprogram: program.c	cc program.c `pkg-config --cflags --libs gnomeui`.fi.PP.PP\fIpkg-config\fP retrieves information about packages from special metadata files. These files are named after the package, with the extension \fI.pc\fP. By default, pkg-config looks in the directory \fIprefix\fP/lib/pkgconfig for these files; it will alsolook in the colon-separated (on Windows, semicolon-separated) list of directories specified by the PKG_CONFIG_PATH environment variable. .PPThe package name specified on the \fIpkg-config\fP command line isdefined to be the name of the metadata file, minus the \fI.pc\fPextension. If a library can install multiple versions simultaneously,it must give each version its own name (for example, GTK 1.2 mighthave the package name "gtk+" while GTK 2.0 has "gtk+-2.0")..SH OPTIONSThe following options are supported:.TP.I "--modversion"Requests that the version information of the libraries specified onthe command line be displayed.  If \fIpkg-config\fP can find all thelibraries on the command line, each library's version string isprinted to stdout, one version per line. In this case \fIpkg-config\fPexits successfully. If one or more libraries is unknown,\fIpkg-config\fP exits with a nonzero code, and the contents of stdoutare undefined..TP.I "--help"Displays a help message and terminates..TP.I "--print-errors"If one or more of the modules on the command line, or theirdependencies, are not found, or if an error occurs in parsinga \fI.pc\fP file, then this option will cause errors explaining theproblem to be printed. With "predicate" options such as "--exists"\fIpkg-config\fP runs silently by default, because it's usually usedin scripts that want to control what's output. This option can be usedalone (to just print errors encountered locating modules on the command line) or with other options. The PKG_CONFIG_DEBUG_SPEWenvironment variable overrides this option..TP.I "--silence-errors"If one or more of the modules on the command line, or theirdependencies, are not found, or if an error occurs in parsing aa \fI.pc\fP file, then this option will keep errors explaining theproblem from being printed. With "predicate" options such as"--exists" \fIpkg-config\fP runs silently by default, because it'susually used in scripts that want to control what's output. So thisoption is only useful with options such as "--cflags" or"--modversion" that print errors by default. The PKG_CONFIG_DEBUG_SPEWenvironment variable overrides this option..TP.I "--errors-to-stdout"If printing errors, print them to stdout rather than the default stderr.PPThe following options are used to compile and link programs:.TP.I "--cflags"This prints pre-processor and compile flags required to compile thepackages on the command line, including flags for all theirdependencies. Flags are "compressed" so that each identical flagappears only once. \fIpkg-config\fP exits with a nonzero code if itcan't find metadata for one or more of the packages on the commandline..TP .I "--libs"This option is identical to "--cflags", only it prints the linkflags. As with "--cflags", duplicate flags are merged (maintainingproper ordering), and flags for dependencies are included in theoutput..TP.I "--libs-only-L"This prints the -L/-R part of "--libs". That is, it defines the library search path but doesn't specify which libraries to link with..TP.I "--libs-only-l"This prints the -l part of "--libs" for the libraries specified onthe command line. Note that the union of "--libs-only-l" and"--libs-only-L" may be smaller than "--libs", due to flags such as-rdynamic..TP.I "--variable=VARIABLENAME"This returns the value of a variable defined in a package's \fI.pc\fPfile. Most packages define the variable "prefix", for example, so you can say:.nf  $ pkg-config --variable=prefix glib-2.0  /usr/.fi.TP.I "--define-variable=VARIABLENAME=VARIABLEVALUE"This sets a global value for a variable, overriding the value in any\fI.pc\fP files. Most packages define the variable "prefix", forexample, so you can say:.nf  $ pkg-config --print-errors --define-variable=prefix=/foo \e               --variable=prefix glib-2.0  /foo.fi.TP.I "--uninstalled"Normally if you request the package "foo" and the package"foo-uninstalled" exists, \fIpkg-config\fP will prefer the "-uninstalled" variant. This allows compilation/linking againstuninstalled packages. If you specify the "--uninstalled" option,\fIpkg-config\fP will return successfully if any "-uninstalled"packages are being used, and return failure (false) otherwise.(The "PKG_CONFIG_DISABLE_UNINSTALLED" environment variable keeps \fIpkg-config\fP from implicitly choosing "-uninstalled" packages, soif that variable is set, they will only have been used if you pass a name like "foo-uninstalled" on the command line explicitly.).TP.I "--exists".TP.I "--atleast-version=VERSION".TP.I "--exact-version=VERSION".TP.I "--max-version=VERSION"These options test whether the package or list of packages on thecommand line are known to \fIpkg-config\fP, and optionally whether the version number of a package meets certain contraints.If all packages exist and meet the specified version constraints,\fIpkg-config\fP exits successfully. Otherwise it exits unsuccessfully.Rather than using the version-test options, you can simply give a versionconstraint after each package name, for example:.nf  $ pkg-config --exists 'glib-2.0 >= 1.3.4 libxml = 1.8.3'.fiRemember to use \-\-print-errors if you want error messages..TP.I "--msvc-syntax"This option is available only on Windows. It causes \fIpkg-config\fPto output -l and -L flags in the form recognized by the MicrosoftVisual C++ command-line compiler, \fIcl\fP. Specifically, instead of\fI-Lx:/some/path\fP it prints \fI/libpath:x/some/path\fP, and insteadof \fI-lfoo\fP it prints \fIfoo.lib\fP. Note that the --libs outputconsists of flags for the linker, and should be placed on the clcommand line after a /link switch. .TP.I "--dont-define-prefix"This option is available only on Windows. It prevents \fIpkg-config\fPfrom automatically trying to override the value of the variable"prefix" in each .pc file..TP.I "--prefix-variable=PREFIX"Also this option is available only on Windows. It sets the name of thevariable that \fIpkg-config\fP automatically sets as described above..TP.I "--static"Output libraries suitable for static linking.  That means including

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -