Mail Archives: djgpp/2001/08/29/19:58:14
> > Reading specs from
/opt/djgpp/lib/gcc-lib/i586-pc-msdosdjgpp/3.0.1/specs
>
> This looks okay, but what's the contents of this specs file?
I'm attaching the specs file to this message.
> Also, what does the compiler print under -v when it links a program?
> I'm specifically looking for the -lfoo switches which it passes to the
> linker.
Here's the part you're interested in (from the end of a g++ -v link line):
-lstdcxx -lm -lgcc -lc -lgcc -Tdjgpp-x.djl
/opt/djgpp/lib/gcc-lib/i586-pc-msdosdjgpp/3.0.1/../../../../i586-pc-msdosdjgpp/bin/stubify
-v ./release/mods.exe stubify for djgpp V2.X executables, Copyright (C)
1995 DJ Delorie
> > Also, if it makes any difference, know that I'm linking with an
> > explicit
> > "ld-dos" command line, not with gcc-dos itself.
>
> Why don't you use gcc-dos? That might be part of your problem. In
> any case, if you invoke the linker directly, you should mention there
> crt0.o and the DJGPP linker script. Otherwise the programs might not
> link correctly.
When I did the linking with g++-dos, everything just worked! No crt0.o,
-lc, -lgcc, or -lstdc++ needed. All I had to do was make a symlink to
libstdc++.a at /opt/djgpp/i586-pc-msdosdjgpp/lib/libstdcxx.a (g++ was
apparently using -lstdcxx internally, rather than -lstdc++).
> > /opt/djgpp/i586-pc-msdosdjgpp/lib/libgcc.a(unwind-dw2-fde.o): In function
> > `read_encoded_value_with_base':
> > unwind-dw2-fde.c:211: multiple definition of `__register_frame_info'
> > /opt/djgpp/i586-pc-msdosdjgpp/lib/libc.a(rfinfo.o)(.text+0x0):rfinfo.c:
> > first defined here
>
> Sorry, my bad: you should say "-lstdc++ -lm -lgcc -lc -lgcc".
Doing this allowed me to successfully link the program with ld-dos.
I'm going to post an updated list of the steps I took to this list which
can hopefully help out anyone trying to do this in the future...
Can't thank you, Tim, and Andris enough!
Yay!
Will Robinson
- Raw text -