Ubuntu 11.10 和 DMD?
我只是从 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
此处对此进行了讨论: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 theDFLAGS
line.