我正在尝试使用Msys和Mingw32安装libpqxx库以使用C ++连接到postgresDB。当我在msys控制台上运行./configure
时,会在控制台上收到此消息(如下)。当我检查pg_config --includedir
目录时,可以看到头文件libpq-fe.h在哪里,我在哪里做不正确。我在Windows平台上,我已经安装了postgres v.10,而libpqxx版本是4.0,而且我也设置了路径环境,因此export PATH="$PATH:/c/Program Files/PostgreSQL/10/bin"
checking for pg_config... /c/Program Files/PostgreSQL/10/bin/pg_config
./configure: line 15928: /c/Program: No such file or directory
configure: using PostgreSQL headers at
./configure: line 15931: /c/Program: No such file or directory
configure: using PostgreSQL libraries at
checking for ANSI C header files... (cached) yes
checking ability to compile programs using the standard C library... yes
checking for library containing select... no
checking for main in -lws2_32... yes
checking /libpq-fe.h usability... no
checking /libpq-fe.h presence... no
checking for /libpq-fe.h... no
configure: error:
Can't find libpq-fe.h in . Are you sure the libpq
headers are installed correctly? They should be in the directory returned by
"pg_config --includedir".
答案 0 :(得分:0)
我发现了问题所在环境PATH varibale中的间距,因此我没有在Program Files文件夹中安装postgres,而是创建了另一个名称中没有空格的文件夹,因此我的导出类似PATH="$PATH:/c/MyPostgreSQLFOLDER/PostgreSQL/10/bin"
可以为文件夹命名,只要不包含任何空格即可。希望这对外面的人有帮助。