为什么我的dsfml代码不是通过dub编译的
我试图使用为什么我的dsfml代码不是通过dub编译的,d,sfml,dub,D,Sfml,Dub,我试图使用dub编译dsfml,但一直出现以下错误: Linking... /usr/bin/ld: cannot find -ldsfml-window /usr/bin/ld: cannot find -ldsfml-system /usr/bin/ld: cannot find -ldsfml-audio /usr/bin/ld: cannot find -ldsfml-network /usr/bin/ld: cannot find -ldsfml-graphics collect2:
dub
编译dsfml,但一直出现以下错误:
Linking...
/usr/bin/ld: cannot find -ldsfml-window
/usr/bin/ld: cannot find -ldsfml-system
/usr/bin/ld: cannot find -ldsfml-audio
/usr/bin/ld: cannot find -ldsfml-network
/usr/bin/ld: cannot find -ldsfml-graphics
collect2: error: ld returned 1 exit status
--- errorlevel 1
FAIL .dub/build/application-debug-linux.posix-x86-dmd_2067-FDAB6DCF10EB7D29BC4DAB2CF2FAFD5C/ dsfmlapps executable
Error executing command build:
dmd failed with exit code 1.
我确保通过存储库在我的Ubuntu(14.04 32位)上安装了sfml和csmfl。你知道有什么问题吗
编辑:这是我的dub.json
文件
{
"name": "dsfmlapps",
"description": "A minimal D application.",
"copyright": "Copyright © 2015, karabuta",
"authors": ["karabuta"],
"lflags" : ["-L/usr/include"],
"dependencies": {
"dsfml": "~master"
}
}
我认为这是DSMFL的
dub.json
中的一个bug。它包含以下形式的库规范:“libs”:[“dsfml audio”]
。但是“libs”
指定在其他地方找到的外部库!这里的名称是dsfml audio
,但是如果您从dsfml中查找build目录,您将看到库文件名为libdsfml\u audio
。(注意名称中的-
与.
相对。)
解决方案是从
dub.json
文件中删除所有“libs”:[“…”],
行。使用dub-v
检查引用的文件 我试过但没能弄明白,但我注意到以下几点:1。我需要链接到csfml-*
,而不是dsfml-*
。2.它似乎引用了许多我在sfmlapi中没有看到的符号(例如sfFont\u getTexturePtr
)。但是,我不熟悉SFML。显示您的dub.json
。不需要sfml/csfml。你读了吗?你可能需要sfml开发标题吗?我知道这是我最常见的链接器错误之一…缺少库文件。您是否已将存档(/)中的文件放置到/usr/include
目录中?