【发布时间】:2020-09-06 17:12:47
【问题描述】:
我正在尝试在 postgres 中创建自己的函数(使用 C),为此我引用了这个文档:http://www.linuxgazette.cz/139/peterson.html
用于编译 - 我指的是:第 33.9.6 节。但是,当我运行以下命令时:
cc -fpic -c example.c
我收到此错误:
example.c:1:22: fatal error: postgres.h: No such file or directory
#include "postgres.h"
^
compilation terminated.
我还安装了 postgresql-server-dev-all 包并尝试使用此链接中提供的解决方案:How to fix 'postgres.h' file not found problem?
没有什么对我有用。请让我知道如何拥有 postgres.h 文件。 我在 centos -7 上使用 postgres-12。
【问题讨论】:
-
您提到的第 33.9.6 节适用于版本 8.2,该版本已经过 EOL。当前部分是37.10.5。它有:
cc -fPIC -c foo.c。我不是 C 程序员,所以我不确定更改为PIC意味着什么。 -
感谢您的建议。但是,即使更换了外壳 - 它对我不起作用。