Ubuntu 11.10 和 DMD?

发布于 2024-12-10 02:45:46 字数 1283 浏览 0 评论 0原文

我只是从 http://www.digitalmars.com/d/download.html 适用于 Ubuntu 64 位 (dmd_2.055-0_amd64.deb)。但是当我尝试

import std.stdio;

void main()
{
    writeln("hello");
}

在终端上使用命令 :$dmd hello.d

运行一个简单的 hello.d 时,显示以下错误:

/usr/lib/gcc/x86_64-linux-gnu/4.6.1/../../../../lib/libphobos2.a(datetime_48b_1ec.o): In function `_D3std8datetime5Clock11currStdTimeFNdNeZl':
std/datetime.d:(.text._D3std8datetime5Clock11currStdTimeFNdNeZl+0x1d): undefined reference to `clock_gettime'
/usr/lib/gcc/x86_64-linux-gnu/4.6.1/../../../../lib/libphobos2.a(time_c0_4d1.o): In function `_D4core4time12TickDuration12_staticCtor7OFNeZv':
src/core/time.d:(.text._D4core4time12TickDuration12_staticCtor7OFNeZv+0x1f): undefined reference to `clock_getres'
/usr/lib/gcc/x86_64-linux-gnu/4.6.1/../../../../lib/libphobos2.a(time_c0_4d1.o): In function `_D4core4time12TickDuration14currSystemTickFNdNeZS4core4time12TickDuration':
src/core/time.d:(.text._D4core4time12TickDuration14currSystemTickFNdNeZS4core4time12TickDuration+0x1f): undefined reference to `clock_gettime'
collect2: ld devolvió el estado de salida 1
--- errorlevel 1

我不知道问题是什么,并且在网上找不到解决方案。

I just install DMD compiler from http://www.digitalmars.com/d/download.html for Ubuntu 64 bits (dmd_2.055-0_amd64.deb). But when I try tu run a simple hello.d

import std.stdio;

void main()
{
    writeln("hello");
}

with the command on a terminal :$dmd hello.d

displays the following error:

/usr/lib/gcc/x86_64-linux-gnu/4.6.1/../../../../lib/libphobos2.a(datetime_48b_1ec.o): In function `_D3std8datetime5Clock11currStdTimeFNdNeZl':
std/datetime.d:(.text._D3std8datetime5Clock11currStdTimeFNdNeZl+0x1d): undefined reference to `clock_gettime'
/usr/lib/gcc/x86_64-linux-gnu/4.6.1/../../../../lib/libphobos2.a(time_c0_4d1.o): In function `_D4core4time12TickDuration12_staticCtor7OFNeZv':
src/core/time.d:(.text._D4core4time12TickDuration12_staticCtor7OFNeZv+0x1f): undefined reference to `clock_getres'
/usr/lib/gcc/x86_64-linux-gnu/4.6.1/../../../../lib/libphobos2.a(time_c0_4d1.o): In function `_D4core4time12TickDuration14currSystemTickFNdNeZS4core4time12TickDuration':
src/core/time.d:(.text._D4core4time12TickDuration14currSystemTickFNdNeZS4core4time12TickDuration+0x1f): undefined reference to `clock_gettime'
collect2: ld devolvió el estado de salida 1
--- errorlevel 1

I don't know what's the problem and I can't find the solution on the web.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

淡淡绿茶香 2024-12-17 02:45:46

此处对此进行了讨论:http://www.digitalmars。 com/webnews/newsgroups.php?art_group=digitalmars.D&article_id=146675

尝试编辑/etc/dmd.conf 并将 -L-lphobos2 移到 DFLAGS 行上的 -L-lrt 之前。

This was discussed here: http://www.digitalmars.com/webnews/newsgroups.php?art_group=digitalmars.D&article_id=146675

Try editing /etc/dmd.conf and moving -L-lphobos2 before -L-lrt on the DFLAGS line.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文