Mail Archives: cygwin/1997/02/21/13:02:53
Nick van Eijndhoven, you wrote:
>
> Dear GNU developers,
> I want to use g++ to perform the ld step of my *.o files to create
> a DLL. The original source files were C++ programs.
> Obviously in this effort I want to prevent the linking in of crt0.o
> and as such I specify
>
> g++ -nostartfiles -o q.dll *.o
>
> However, it seems that crt0.o is still linked in since I get an unresolved
> reference to main() from libmain.a.
> Do I understand something wrong here, or is the option -nostartfiles
> not working ?
What's the output of `g++ -v -nostartfiles -o q.dll *.o'?
> I also tried
>
> ld -o q.dll *.o -L'the proper directory' -lg++
>
> but in this case the standard I/O facilities 'cout' and co. were not found.
You probably need to add `-lc -lcygwin -lkernel32 -lc'
at the end of your ld command.
Actually I forget the right order;
it might be `-lcygwin -lkernel32 -lc -lcygwin'.
Check what g++ does with `-v', and do the same (minus crt0).
--
Fergus Henderson <fjh AT cs DOT mu DOT oz DOT au> | "I have always known that the pursuit
WWW: <http://www.cs.mu.oz.au/~fjh> | of excellence is a lethal habit"
PGP: finger fjh AT 128 DOT 250 DOT 37 DOT 3 | -- the last words of T. S. Garp.
-
For help on using this list, send a message to
"gnu-win32-request AT cygnus DOT com" with one line of text: "help".
- Raw text -