简体   繁体   English

pkg-config不适用于Cygwin

[英]pkg-config doesn't work on Cygwin

I try to compile a program ( OpenFP ) using cygwin. 我尝试使用cygwin编译程序( OpenFP )。 The program depends on a package FFTW3 which I've compiled and installed succesfully. 该程序依赖于FFTW3包,我已成功编译和安装。 However when I launch ./configure for the main program I get an error: 但是,当我为主程序启动./configure ,我收到一个错误:

No package 'fftw3' found configure:6138: error: Package requirements ("fftw3") were not met: No package 'fftw3' found Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. 未找到包'fftw3'configure:6138:error:未满足包要求(“fftw3”):未找到包'fftw3'如果您在非标准前缀中安装了软件,请考虑调整PKG_CONFIG_PATH环境变量。 Alternatively, you may set the environment variables FFTW3_CFLAGS and FFTW3_LIBS to avoid the need to call pkg-config. 或者,您可以设置环境变量FFTW3_CFLAGS和FFTW3_LIBS以避免需要调用pkg-config。 See the pkg-config man page for more details. 有关更多详细信息,请参见pkg-config手册页。

pkg-config --list-all doesn't find fftw3 library but /usr/local/lib/pckconfig contains required .pc file. pkg-config --list-all找不到fftw3库,但/usr/local/lib/pckconfig包含必需的.pc文件。 Ok, from that file fftw3.pc i copied LIBS and CFLAGS parameters into FFTW3_CFLAGS and FFTW3_LIBS evironment variables as the error message above prompted. 好的,从该文件fftw3.pc我将LIBSCFLAGS参数复制到FFTW3_CFLAGSFFTW3_LIBS环境变量中,作为上面提示的错误消息。 However I'm still getting the same error. 但是我仍然得到同样的错误。

What's wrong? 怎么了?

PS Setting variables the same way in MinGW solved the problem (I have not installed pkg-config in MinGW), but compilation of the project failed due to the lack of some linux-specific headers in MinGW) PS在MinGW中以相同的方式设置变量解决了问题(我没有在MinGW中安装pkg-config),但由于MinGW中缺少某些特定于Linux的头文件,项目编译失败了)

You should add /usr/local/lib/pckconfig to your PKG_CONFIG_PATH : 您应该将/usr/local/lib/pckconfigPKG_CONFIG_PATH

$ export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/usr/local/lib/pkgconfig

This tells pkg-config to look in an additional location, besides its standard path. 这告诉pkg-config除了标准路径外还要查看其他位置。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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