【问题标题】:compiling gpsim on macOS causes "error: 'long long type-name' is invalid"在 macOS 上编译 gpsim 会导致“错误:'long long type-name' is invalid”
【发布时间】:2020-04-25 14:18:12
【问题描述】:

this question 之后,我正在尝试在 macOS 上编译 this code。我跑了

/System/Volumes/Data/usr/local/Cellar/qt/5.14.1/bin/qmake

成功进入build_XX文件夹,然后进入make。但是,我得到了编译错误:

../src/gpsim/protocol.cc:79:8: 错误:'long long type-name' 无效 uint long long i = ascii2uint64(缓冲区,数字); ^ 产生 1 个错误。 make: *** [build/release/protocol.o] 错误 1

按照here的建议,我添加了

#ifdef __APPLE__
#include <sys/types.h>
#endif // __APPLE__

protocol.cc 文件的顶部无济于事。如果您能帮助我了解问题所在以及如何解决,我将不胜感激。提前感谢您的支持。

【问题讨论】:

    标签: c++ macos compiler-errors clang


    【解决方案1】:

    没有uint long long这样的类型。

    long longunsigned long long

    Qt 还提供qlonglong

    【讨论】:

    • 所以这是一个错误,还有其他编译器吗?与macOS或clang无关?
    • OP 提到了 Qt。 Qt 实际上提供了uint。因此,我有点困惑为什么uint long long 不应该工作。当然,我没有深入挖掘。缺少 Qt 标头可能会解释...
    • @Foad 据我所知,是的。
    • 它工作了,但我会等待@JesperJuhl 看看为什么 Qt 在这里不能正常工作。
    • @Foad 太有趣了,我注意到链接的 github 存储库中的最后两个提交,其中包含“long long fixed”之类的内容,在您发送问题之前仅 13 分钟(!)出现...... ;-)
    猜你喜欢
    • 1970-01-01
    • 2010-12-26
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-09-27
    • 1970-01-01
    • 2021-02-03
    相关资源
    最近更新 更多