我在尝试构建使用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