【问题标题】:Perfect + Mongo project build errors on ubuntuPerfect + Mongo 项目在 ubuntu 上构建错误
【发布时间】:2017-03-20 17:59:12
【问题描述】:

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

libbsonlibmongoc 都已安装:

~# 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


    【解决方案1】:

    好的,here 我找到了perfect 的这个神奇的依赖项列表,为我修复了错误。我不确定其中缺少的软件包是什么导致了这个问题,但它现在可以工作了。

    # apt-get install clang pkg-config libicu-dev libpython2.7 libxml2-dev wget git libssl-dev uuid-dev libsqlite3-dev libpq-dev libmysqlclient-dev libbson-dev libmongoc-dev libcurl4-openssl-dev
    Reading package lists... Done
    Building dependency tree       
    Reading state information... Done
    git is already the newest version (1:2.7.4-0ubuntu1).
    libbson-dev is already the newest version (1.3.1-1).
    libmongoc-dev is already the newest version (1.3.1-1).
    libicu-dev is already the newest version (55.1-7ubuntu0.1).
    libpython2.7 is already the newest version (2.7.12-1ubuntu0~16.04.1).
    libssl-dev is already the newest version (1.0.2g-1ubuntu4.6).
    uuid-dev is already the newest version (2.27.1-6ubuntu3.2).
    wget is already the newest version (1.17.1-1ubuntu1.1).
    clang is already the newest version (1:3.8-33ubuntu3.1).
    The following additional packages will be installed:
      build-essential comerr-dev cpp cpp-5 dpkg-dev fakeroot g++ g++-5 gcc gcc-5 krb5-multidev libalgorithm-diff-perl libalgorithm-diff-xs-perl libalgorithm-merge-perl libcc1-0
      libdpkg-perl libfakeroot libfile-fcntllock-perl libgssrpc4 libisl15 libkadm5clnt-mit9 libkadm5srv-mit9 libkdb5-8 libmpc3 libmysqlclient20 libpq5 make mysql-common
    Suggested packages:
      doc-base cpp-doc gcc-5-locales debian-keyring g++-multilib g++-5-multilib gcc-5-doc libstdc++6-5-dbg gcc-multilib autoconf automake libtool flex bison gdb gcc-doc
      gcc-5-multilib libgcc1-dbg libgomp1-dbg libitm1-dbg libatomic1-dbg libasan2-dbg liblsan0-dbg libtsan0-dbg libubsan0-dbg libcilkrts5-dbg libmpx0-dbg libquadmath0-dbg
      krb5-doc libcurl4-doc libcurl3-dbg libidn11-dev libkrb5-dev libldap2-dev librtmp-dev krb5-user postgresql-doc-9.5 sqlite3-doc make-doc
    The following NEW packages will be installed:
      build-essential comerr-dev cpp cpp-5 dpkg-dev fakeroot g++ g++-5 gcc gcc-5 krb5-multidev libalgorithm-diff-perl libalgorithm-diff-xs-perl libalgorithm-merge-perl libcc1-0
      libcurl4-openssl-dev libdpkg-perl libfakeroot libfile-fcntllock-perl libgssrpc4 libisl15 libkadm5clnt-mit9 libkadm5srv-mit9 libkdb5-8 libmpc3 libmysqlclient-dev
      libmysqlclient20 libpq-dev libpq5 libsqlite3-dev libxml2-dev make mysql-common pkg-config
    0 upgraded, 34 newly installed, 0 to remove and 0 not upgraded.
    Need to get 30.4 MB of archives.
    After this operation, 97.4 MB of additional disk space will be used.
    Do you want to continue? [Y/n] y
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2014-07-26
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-02-07
      • 2016-10-01
      • 1970-01-01
      相关资源
      最近更新 更多