pkg-config: command not found, using cygwin on win

2019-02-24 05:12发布

I'm using Cygwin on windows to run this command:

 g++ `pkgconfig --libs --cflags opencv` -I. -o mergevec mergevec.cpp ....

But I get an error:

-bash: pkg-config: command not found

I've installed cygwin directly on C:. I've added to the PATH environment variable the following:

C:\cygwin64\bin;
C:\cygwin64\lib

I've run cygcheck -c and it gives me a whole list of packages, but pkg-config isn't in that list. There is a folder called pkgconfig in C:\cygwin64\lib though. How do I fix this error?

2条回答
萌系小妹纸
2楼-- · 2019-02-24 05:56

pkg-config is a piece of software that allow your computer to check installed libraries for source compilation. It may not be installed on Windows so in last scenario please check for install.

However in your case i think it is installed, but not set on the right path for linux commands. Try to type in cygwin:

$ export PKG_CONFIG_PATH=c:\\cygwin\\usr\\local\\lib\\pkgconfig 

as stated in this post.

Otherwise just abandon Windows and try to compile mergevec on an Linux VM, which is really easier (it was made for it). The only down point of this method is that you will have to do the mergevec operation (and the ones before, otherwise you may have encoding problems) under your linux space. See my previous answer for this manipulation.

If any problem don't hesitate.

查看更多
Deceive 欺骗
3楼-- · 2019-02-24 05:56

enter image description here

run cgywin setup and in package search type pkg-config then make sure that pkg-config utility is installed. it should solve the not found command problem.

查看更多
登录 后发表回答