【问题标题】:Unable to run D program on mac system when using dependencymac系统使用依赖时无法运行D程序
【发布时间】:2018-01-10 13:45:57
【问题描述】:

我对 D 语言很陌生。我正在研究其他人开发的现有代码。以前的开发人员使用 linux 环境来构建和运行 D 应用程序。 我正在尝试在 MAC 中做同样的事情,因为它是我的本地环境。

这是我的 jub.json 文件的样子

{
    "name" : "dsmasher",
    "description" : "Hello World - A minimal DUB bundle.",
    "dependencies" : {
        "d2sqlite3": "~>0.9.7",
        "botan": "~>1.12.9"
    }
}

程序很简单

import std.stdio;

int main () {
   return 0;
}

但是当我构建它时会引发以下错误。

/Library/D/dmd/src/druntime/import/object.d(3440,23): Error: template memutils.refcounted.RefCounted!(X509CertificateImpl, ThreadMem).RefCounted.opCast does not match any template declaration
/Library/D/dmd/src/druntime/import/object.d(3440,49): Error: template memutils.refcounted.RefCounted!(X509CertificateImpl, ThreadMem).RefCounted.opCast does not match any template declaration
/Library/D/dmd/src/druntime/import/object.d(3441,39): Error: template memutils.refcounted.RefCounted!(X509CertificateImpl, ThreadMem).RefCounted.opCast does not match any template declaration
../../../.dub/packages/memutils-0.4.9/memutils/source/memutils/vector.d(790,10): Error: template instance object.__equals!(const(RefCounted!(X509CertificateImpl, ThreadMem)), const(RefCounted!(X509CertificateImpl, ThreadMem))) error instantiating
../../../.dub/packages/memutils-0.4.9/memutils/source/memutils/helpers.d(71,27):        instantiated from here: opEquals!()
../../../.dub/packages/botan-1.12.9/botan/source/botan/tls/server.d(689,38):        instantiated from here: opEquals!(RefCounted!(Vector!(RefCounted!(X509CertificateImpl, ThreadMem), ThreadMem), ThreadMem))
/Library/D/dmd/bin/dmd failed with exit code 1.
  ^^^ Terminated, exit code: 2 ^^^
************  Build terminated.  ************

我为此使用 dmd 编译器。 如果您有任何想法,请提供帮助。

【问题讨论】:

    标签: d dmd


    【解决方案1】:

    这似乎是 Botan 中的一个错误。根据 Travis CI 的说法,他们的构建失败并出现 the same message

    【讨论】:

    • 所以要构建 Hello World 示例:删除 "d2sqlite3": "~>0.9.7" 和 "botan": "~>1.12.9" 依赖项。 Hello World 不需要它们 :)
    猜你喜欢
    • 1970-01-01
    • 2013-10-21
    • 2022-11-18
    • 1970-01-01
    • 2012-02-06
    • 1970-01-01
    • 1970-01-01
    • 2023-04-01
    • 1970-01-01
    相关资源
    最近更新 更多