如何修复“postgres.h"文件未找到的问题? [英] How to fix 'postgres.h' file not found problem?

查看:217
本文介绍了如何修复“postgres.h"文件未找到的问题?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试用 C 编写 PostgreSQL 的基本类型(使用 xcode),并且我已经安装了 PostgreSQL 11,但似乎 postgres.h 不能简单地包含在文件中(未找到postgres.h"文件").

I am trying to write a base type for PostgreSQL in C (using xcode), and I already installed PostgreSQL 11, but it seems that postgres.h cannot be simply included in the file ("'postgres.h' file not found").

谁能告诉我如何解决这个问题?而且可以在任意目录下写代码,还是一定要写在PostgreSQL目录下?

Could someone tell me how to fix that problem? And can I write code under an arbitary directory, or do I have to write under the PostgreSQL directory?

或者问题应该是:如何安装像postgres.h这样的头文件?

Or perhaps the question should be: how to install header files like postgres.h?

推荐答案

使用以下命令安装 postgresql-server-dev 包:

Install postgresql-server-dev package with this command:

sudo apt install postgresql-server-dev-XX

用你已经安装的 postgresql:9.5, 10, 11, 12 版本替换 [XX]

Replace [XX] with your already installed version of postgresql:9.5, 10, 11, 12

这篇关于如何修复“postgres.h"文件未找到的问题?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆