【问题标题】:Cant find libpq-fe.h when compiling the libpqxx C++ library for postgresql为 postgresql 编译 libpqxx C++ 库时找不到 libpq-fe.h
【发布时间】:2019-02-04 20:40:19
【问题描述】:

我正在尝试安装 libpqxx 库以使用 C++ 连接到 postgresDB,我正在使用 Msys 和 Mingw32。当我在 msys 控制台上运行 ./configure 时,我在控制台上收到此消息(如下)。当我检查pg_config --includedir 目录时,我可以看到头文件 libpq-fe.h 在那里,我在哪里做错了。我在windows平台上我已经安装了postgres v.10 libpqxx版本是4.0也是我设置的路径环境,所以导出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".

【问题讨论】:

    标签: c++ postgresql libpqxx


    【解决方案1】:

    我发现问题在于环境 PATH 变量中的间距,因此我没有在 Program files 文件夹中安装 postgres,而是创建了另一个名称中没有空格的文件夹,所以我的导出类似于 PATH="$PATH:/c/MyPostgreSQLFOLDER/PostgreSQL/10/bin" 你可以命名您想要的文件夹名称中不要包含任何空格。希望这对那里的任何人都有帮助。

    【讨论】:

      猜你喜欢
      • 2020-03-04
      • 2012-10-16
      • 2011-08-27
      • 2018-10-20
      • 2019-08-23
      • 1970-01-01
      • 2015-05-03
      • 2020-03-16
      相关资源
      最近更新 更多