相关疑难解决方法(0)

如何在xcode项目中设置包含路径

我想在Objective-C Xcode项目中使用C库.

库目录结构如下:

-- include/
    |-- config.h
    |-- lib/
    |    |-- file1.h
    |    |-- file2.h
    |    |-- file3.h
Run Code Online (Sandbox Code Playgroud)

该库的文档说包含file1.h,file1.h包括file2.h和file3.h.

我收到file2.h和file3.h`的包含"文件未找到"错误.file1.h以下列方式包含它们:

#include <lib/file1.h>
#include <lib/file2.h>
Run Code Online (Sandbox Code Playgroud)

在这里读到这些尖括号指示预处理器沿着INCLUDE环境变量指定的路径搜索包含文件,而不是在与包含#include的文件相同的目录中进行搜索.

所以我通过转到Product-> Edit Scheme ..在Xcode中添加了INCLUDE环境变量,然后将其设置为/the-whole-path-to/include/,我仍然得到文件未找到错误.

如果我更改file1.h以包含它们,则成功包含文件:

#include "file2.h"
Run Code Online (Sandbox Code Playgroud)

但是我不想为库中的每个文件都这样做.

我怎样才能解决这个问题?

c xcode environment-variables include

53
推荐指数
4
解决办法
9万
查看次数

如何安装特定版本的postgres?

我需要在 Ubuntu 14.04 上安装postgres 9.6.6,但是命令

apt-get install postgresql-9.6
Run Code Online (Sandbox Code Playgroud)

安装 9.6.7

如何安装 9.6.6?

命令的输出

apt-cache policy postgresql-9.6
Run Code Online (Sandbox Code Playgroud)

postgresql-9.6:
  Installed: 9.6.7-1.pgdg14.04+1
  Candidate: 9.6.7-1.pgdg14.04+1
  Version table:
 *** 9.6.7-1.pgdg14.04+1 0
        500 http://apt.postgresql.org/pub/repos/apt/ trusty-pgdg/main amd64 Packages
        100 /var/lib/dpkg/status
Run Code Online (Sandbox Code Playgroud)

linux postgresql ubuntu

10
推荐指数
2
解决办法
2万
查看次数

标签 统计

c ×1

environment-variables ×1

include ×1

linux ×1

postgresql ×1

ubuntu ×1

xcode ×1