MailCore / mailcore2

MailCore 2 provide a simple and asynchronous API to work with e-mail protocols IMAP, POP and SMTP. The API has been redesigned from ground up.
Other
2.61k stars 624 forks source link

Linux build failure (Ubuntu 18.04) #1877

Open mattmaddux opened 4 years ago

mattmaddux commented 4 years ago

Building Mailcore2 fails on Linux (following directions from here).

Outputs this error:

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
ZanyScum commented 3 years ago

5 months later I have the same error in Debian. Do we both do something wrong or is it just bugged?

dinhvh commented 3 years ago

Could you just remove that line locally on source of MailCore?

/home/user/mailcore2/build/src/include/MailCore/MCICUTypes.h, line 16

typedef __CHAR16_TYPE__ UChar;

It should help it build.

ZanyScum commented 3 years ago

Could you just remove that line locally on source of MailCore? /home/user/mailcore2/build/src/include/MailCore/MCICUTypes.h, line 16 typedef CHAR16_TYPE UChar; It should help it build.

I changed "src/core/basetypes/MCICUTypes.h" (not in build) to `

ifndef MAILCORE_MCICUTYPES_H

define MAILCORE_MCICUTYPES_H

include "icu-ucsdet/include/unicode/umachine.h"

ifdef _MSC_VER

typedef wchar_t UChar;

//#elif defined(__CHAR16_TYPE__)

//typedef __CHAR16_TYPE__ UChar;

//#else

//typedef uint16_t UChar;

endif

endif

` and installed libssl-dev which I was still missing. Then the build run through. Thank you for pointing me into the right direction. Mmm, building does not mean it is now correct.

vonox7 commented 3 years ago

Fyi: https://github.com/MailCore/mailcore2/pull/1912 explains the build pipeline on Android that works also in 2021 on macOS, building it on linux is probably pretty much the same. The troubleshooting part of this PR also explains how to fix the errors you encountered.

CodeMouse92 commented 3 years ago

@vonox7 I don't see anything in that PR relating to the aforementioned declaration conflict with UChar.

vonox7 commented 3 years ago

@vonox7 I don't see anything in that PR relating to the aforementioned declaration conflict with UChar.

Have you tried using the Android NDK and SDK versions as described in the PR? The correct versions fixed at least for me exactly this error. (But probably you encounter a different error that has just the same error message)

CodeMouse92 commented 3 years ago

@vonox7 Building on Linux (desktop), the Android SDK doesn't even enter into it, mate. See?