小编Max*_*huu的帖子

CMake无法链接PostgreSQL库

我需要一些C语言中PostgreSQL扩展的帮助

我有一点测试扩展,看看有什么不起作用.似乎cmake找到了Libraries但只能将GDAL链接到我的项目.构建时我收到此错误消息:

/Applications/CLion.app/Contents/bin/cmake/bin/cmake --build /Users/Max/Library/Caches/clion10/cmake/generated/6306a90e/6306a90e/Debug --target Project -- -j 2
Scanning dependencies of target Project
[100%] Building C object CMakeFiles/Project.dir/main.c.o
Linking C executable Project
Undefined symbols for architecture x86_64:
  "_Float4GetDatum", referenced from:
      _main in main.c.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[3]: *** [Project] Error 1
make[2]: *** [CMakeFiles/Project.dir/all] Error 2
make[1]: *** [CMakeFiles/Project.dir/rule] Error 2
make: *** [Project] Error 2
Run Code Online (Sandbox Code Playgroud)

main.c中

#include <postgres.h>
#include …
Run Code Online (Sandbox Code Playgroud)

postgresql macos cmake

6
推荐指数
0
解决办法
1606
查看次数

标签 统计

cmake ×1

macos ×1

postgresql ×1