在Linux上构建Mailcore2

时间:2020-06-29 18:38:22

标签: linux ubuntu ubuntu-18.04 mailcore2 mailcore

我正在尝试在Linux(Ubuntu 18.04)上构建mailcore2库,但遇到了困难。 (通常)按照此处的回购指示进行操作:https://github.com/MailCore/mailcore2/blob/master/build-linux/README.md

所以首先我安装依赖项(一切正常):

sudo apt-get install libctemplate-dev libicu-dev libsasl2-dev libtidy-dev \
    uuid-dev libxml2-dev libglib2.0-dev autoconf automake libtool cmake

然后它指示如何构建libetpan,但我使用的是libtepan存储库中的更新指令:https://github.com/dinhviethoa/libetpan

git clone https://github.com/dinhviethoa/libetpan
cd libetpan
./autogen.sh
make
sudo make install

最后,我尝试构建MailCore:

git clone https://github.com/MailCore/mailcore2
cd mailcore2
mkdir build
cd build
cmake ..
make

但是无论我使用什么提交,我总是会遇到以下错误:

In file included from /home/<USER>/mailcore2/src/core/basetypes/MCString.h:7:0,
                 from /home/<USER>/mailcore2/src/core/basetypes/MCData.cpp:24:
/home/<USER>/mailcore2/build/src/include/MailCore/MCICUTypes.h:16:25: error: conflicting declaration ‘typedef short unsigned int UChar’
 typedef __CHAR16_TYPE__ UChar;
                         ^~~~~
In file included from /usr/include/unicode/utypes.h:38:0,
                 from /usr/include/unicode/ucsdet.h:24,
                 from /home/<USER>/mailcore2/src/core/basetypes/MCData.cpp:15:
/usr/include/unicode/umachine.h:347:22: note: previous declaration as ‘typedef char16_t UChar’
     typedef char16_t UChar;
                      ^~~~~
src/CMakeFiles/MailCore.dir/build.make:182: recipe for target 'src/CMakeFiles/MailCore.dir/core/basetypes/MCData.cpp.o' failed
make[2]: *** [src/CMakeFiles/MailCore.dir/core/basetypes/MCData.cpp.o] Error 1
CMakeFiles/Makefile2:85: recipe for target 'src/CMakeFiles/MailCore.dir/all' failed
make[1]: *** [src/CMakeFiles/MailCore.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2

我已经在iOS上使用了一段时间(通过CocoaPods),但是想将我的电子邮件功能转移到服务器端。我在Github上打开了一个问题,但没有任何帮助。

1 个答案:

答案 0 :(得分:1)

/home/<USER>/mailcore2/build/src/include/MailCore/MCICUTypes.h

替换:

typedef __CHAR16_TYPE__ UChar;

具有:

typedef char16_t UChar;

然后运行:

make clean
make