Mail Archives: cygwin/2001/03/21/19:10:03
On Wed, 21 Mar 2001, Earnie Boyd wrote:
> Nate Lawson wrote:
> >
> > On Wed, 21 Mar 2001, Earnie Boyd wrote:
> > > Nate Lawson wrote:
> > > >
> > > > Thanks for the help getting the dll to compile. It worked. However, I'm
> > > > still having linking problems.
> > > >
> > > > 1. Does it matter whether a DLL is linked in character or windows
> > > > mode? (It makes no GDI calls).
> > > > 2. Should I use gcc -shared or gcc -mdll to build?
> > > > 3. Why can't it find dllcrt2.o? I've tried adding -lmsvcrt or -ldllcrt
> > > > but no luck.
> > > >
> > > > Here is my linking line:
> > > > gcc -mwindows -mno-cygwin -DDBG -s -Wl,--out-implib,Packet.a
> > > > -mdll -o Packet.dll Packet.def Packet32.o -L /usr/lib/mingw
> > > > /usr/lib/gcc-lib/i686-pc-cygwin/gcc-2.95.2-9/../../../../i686-pc-cygwin/bin/ld:
> > > > cannot open dllcrt2.o: No such file or directory
> > > > collect2: ld returned 1 exit status
> > > > make: *** [main] Error 1
> > > >
> > >
> > > Did you install the mingw package? The -mno-cygwin indicates to gcc
> > > that you want to build mingw programs.
> > >
> > > Earnie.
> >
> > Indeed I did:
> >
> > $ ls -l /usr/lib/mingw/
> > total 801
> > -rw-r--r-- 1 xx 544 390 Jan 30 15:23 CRT_noglob.o
> > -rw-r--r-- 1 xx 544 1899 Jan 30 15:23 crt1.o
> > -rw-r--r-- 1 xx 544 1989 Jan 30 15:23 crt2.o
> > -rw-r--r-- 1 xx 544 379 Jan 30 15:23 crtmt.o
> > -rw-r--r-- 1 xx 544 379 Jan 30 15:23 crtst.o
> > -rw-r--r-- 1 xx 544 628 Jan 30 15:23 dllcrt1.o
> > -rw-r--r-- 1 xx 544 628 Jan 30 15:23 dllcrt2.o
> > -rw-r--r-- 1 xx 544 62322 Jan 30 15:23 libcoldname.a
> > -rw-r--r-- 1 xx 544 297594 Jan 30 15:23 libcrtdll.a
> > -rw-r--r-- 1 xx 544 7248 Jan 30 15:23 libmingw32.a
> > -rw-r--r-- 1 xx 544 1934 Jan 30 15:23 libmingwthrd.a
> > -rw-r--r-- 1 xx 544 63402 Jan 30 15:23 libmoldname.a
> > -rw-r--r-- 1 xx 544 406408 Jan 30 15:23 libmsvcrt.a
> > -rw-r--r-- 1 xx 544 398358 Jan 30 15:23 libmsvcrt20.a
> > -rw-r--r-- 1 xx 544 390724 Jan 30 15:23 libmsvcrt40.a
>
> Hmm... What happens if you
> gcc -L /usr/lib/mingw -mwindows -mno-cygwin -DDBG -s
> -Wl,--out-implib,Packet.a
> -mdll -o Packet.dll Packet.def Packet32.o
> instead. The -L switch is position dependent, although it shouldn't be
> required.
Same thing. Also same thing if I remove the -L completely. I've also
tried -lmsvcrt, -lcrtdll, and every other lib in the /usr/lib/mingw
directory -- all same error. I cannot get -mno-cygwin to link this DLL.
BTW, I was able to get it to link by removing -mno-cygwin but this creates
a DLL that crashes my application. If I use the same DLL compiled under
MSVC, the app works fine with no recompilation.
-Nate
--
Want to unsubscribe from this list?
Check out: http://cygwin.com/ml/#unsubscribe-simple
- Raw text -