我正在尝试构建一个需要libpq-fe.h
包含文件的程序。
此文件位于E:\MinGW\msys\1.0\local\pgsql\include
在我的CMakeLists.txt中,我有:
cmake_minimum_required(VERSION 3.0)
# declare project
PROJECT(localscp)
set(pg_SOURCE_DIR /usr/local/pgsql)
INCLUDE_DIRECTORIES(
"E:/MinGW/msys/1.0/local/psql/include"
)
# declare executables
ADD_EXECUTABLE(localscp localscp.cc)
TARGET_LINK_LIBRARIES(localscp
dl pthread z pq)
当我cmake .
时,我得到:
-- Configuring done
-- Generating done
-- Build files have been written to: E:/informemedico/localscp
当我mingw32-make
时,我得到:
[ 50%] Building CXX object CMakeFiles/localscp.dir/localscp.cc.obj
E:\informemedico\localscp\localscp.cc:24:22: fatal error: libpq-fe.h: No such file or directory compilation terminated.
CMakeFiles\localscp.dir\build.make:62: recipe for target 'CMakeFiles/localscp.dir/localscp.cc.obj' failed
mingw32-make[6]: *** [CMakeFiles/localscp.dir/localscp.cc.obj] Error 1
CMakeFiles\Makefile2:66: recipe for target 'CMakeFiles/localscp.dir/all' failed
mingw32-make[5]: *** [CMakeFiles/localscp.dir/all] Error 2
makefile:82: recipe for target 'all' failed
mingw32-make[4]: *** [all] Error 2
为什么编译器找不到包含文件?。