【发布时间】:2017-03-20 17:59:12
【问题描述】:
我在尝试构建使用 Perfect-HTTPServer 和 Perfect-MongoDB 包依赖项的 swift 应用程序时遇到这些错误
Compile Swift Module 'MongoDB' (7 sources)
<module-includes>:1:10: note: in file included from <module-includes>:1:
#include "/usr/local/include/libmongoc-1.0/mongoc.h"
^
/usr/local/include/libmongoc-1.0/mongoc.h:22:10: error: 'bson.h' file not found
#include <bson.h>
^
/root/mobile-backend/Packages/MongoDB-2.0.8/Sources/MongoDB/MongoGridFS.swift:20:8: error: could not build Objective-C module 'libmongoc'
import libmongoc
^
<unknown>:0: error: build had 1 command failures
libbson 和 libmongoc 都已安装:
~# apt-get install libmongoc-dev libbson-dev
Reading package lists... Done
Building dependency tree
Reading state information... Done
libbson-dev is already the newest version (1.3.1-1).
libmongoc-dev is already the newest version (1.3.1-1).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
我确保按照Perfect-MongoDB 的说明将它们符号链接到该位置:
~# ls -l /usr/local/include
total 0
lrwxrwxrwx 1 root root 24 Mar 20 17:05 libbson-1.0 -> /usr/include/libbson-1.0
lrwxrwxrwx 1 root root 26 Mar 20 17:00 libmongoc-1.0 -> /usr/include/libmongoc-1.0
【问题讨论】:
标签: swift mongodb ubuntu-16.04 perfect