在两个单独的步骤中使用DMD:链接64位(Linux)

时间:2022-09-01 11:12:49

I'm running on 64-bit Ubuntu, and trying to get DMD v2.052 to work with Code::Blocks. The problem is, Code::Blocks does compiling and linking in two separate steps, and I can't seem to get around that. My compiler flags (for this project) are -m64, and my linker flags are all the ones supplied in dmd.conf. However, I get errors when I try to do this, like

我在64位Ubuntu上运行,并尝试使用DMD v2.052来处理Code :: Blocks。问题是,Code :: Blocks确实在两个单独的步骤中编译和链接,我似乎无法解决这个问题。我的编译器标志(对于这个项目)是-m64,我的链接器标志是dmd.conf中提供的所有标志。但是,当我尝试这样做时,我会收到错误


Linking console executable: bin/Debug/Gossamer
/usr/bin/ld: skipping incompatible /home/me/devl/sfml2/bindings/d/lib/libdsfml-system.a when searching for -ldsfml-system
/usr/bin/ld: cannot find -ldsfml-system
/usr/bin/ld: skipping incompatible /home/me/devl/sfml2/bindings/d/lib/libdsfml-graphics.a when searching for -ldsfml-graphics
/usr/bin/ld: cannot find -ldsfml-graphics
/usr/bin/ld: skipping incompatible /home/me/devl/sfml2/bindings/d/lib/libdsfml-audio.a when searching for -ldsfml-audio
/usr/bin/ld: cannot find -ldsfml-audio
/usr/bin/ld: skipping incompatible /home/me/devl/sfml2/bindings/d/lib/libdsfml-window.a when searching for -ldsfml-window
/usr/bin/ld: cannot find -ldsfml-window
collect2: ld returned 1 exit status

I compiled the DSFML libs myself, using dmd -m64 -lib [library source code files], and there it wasn't in two steps, so I know they're fine. It seems ld doesn't like them, for some reason. Can somebody help?

我自己使用dmd -m64 -lib [库源代码文件]编译了DSFML库,并且它没有分两步,所以我知道它们没问题。由于某种原因,似乎ld不喜欢它们。有人可以帮忙吗?

1 个解决方案

#1


2  

Try doing the compile from the command line using just DMD. If that works I think there is a flag that will cause DMD to print the command line for the link command. From that you should be able to tell what you need Code::Blocks to do differently.

尝试使用DMD从命令行进行编译。如果有效,我认为有一个标志会导致DMD打印链接命令的命令行。从那以后你应该能够告诉你需要Code :: Blocks做什么不同。

#1


2  

Try doing the compile from the command line using just DMD. If that works I think there is a flag that will cause DMD to print the command line for the link command. From that you should be able to tell what you need Code::Blocks to do differently.

尝试使用DMD从命令行进行编译。如果有效,我认为有一个标志会导致DMD打印链接命令的命令行。从那以后你应该能够告诉你需要Code :: Blocks做什么不同。