DMD2 - compiling and linking in separate steps (64-bit)

Sean Eskapp eatingstaples at gmail.com
Sat Mar 19 06:52:05 PDT 2011


== Quote from Jonathan M Davis (jmdavisProg at gmx.com)'s article
> On Friday 18 March 2011 20:49:58 Sean Eskapp wrote:
> > incompatible /usr/lib/../lib/librt.so when searching
> > for -lrt
> > /usr/bin/ld: skipping incompatible /usr/lib/../lib/librt.a when searching
> > for -lrt
> > /usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-
> > gnu/4.4.5/../../../librt.so when searching for -lrt
> > /usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-
> > gnu/4.4.5/../../../librt.a when searching for -lrt
> > /usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-
> > gnu/4.4.5/../../../../lib/libc.so
> Look at dmd.conf. It includes several flags which are supposed to be passed to
> the linker - either that or you can use dmd to link rather than using gcc on its
> own. Personally, I wouldn't bother compiling and linking as separate steps, but
> if you do, you need to make sure that you either use the flags in dmd.conf or you
> link with dmd rather than gcc. For the most part, there's no reason to link with
> gcc, even if you want to link separately.
> - Jonathan M Davis

Hmm.. after linking with all the options in dmd.conf (-L/usr/lib32 -L/usr/lib64 --no-warn-search-mismatch --export-dynamic -lrt), I still get

/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

Now, I compiled libdsfml-system.a myself, and I know they're 64-bit, so this implies ld still isn't recognizing that I want 64-bit executables.


More information about the Digitalmars-d-learn mailing list