public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* Problem building DLLhelpers using Cygwin
@ 2000-07-18  9:17 Vassili Sukharev
  2000-07-18 11:57 ` Charles Wilson
  0 siblings, 1 reply; 2+ messages in thread
From: Vassili Sukharev @ 2000-07-18  9:17 UTC (permalink / raw)
  To: cygwin

Hi All,

I need to build a dll with the cygwin gcc. As a starting point, I tried
building a few dll examples, called dllhelpers, available from the following
page:

http://www.nanotech.wisc.edu/~khan/software/gnu-win32/dllhelpers.html

There is a version for cygwin, which is supposed to be buildable without any
adjustments to makefile. Upon typing make, the following happens:

c++ -c -DBUILDING_DLL=1 -I. -I/mingw/include -g  -mno-cygwin -o dllclass.o
dllclass.cc
c++ -c -DBUILDING_DLL=1 -I. -I/mingw/include -g  -mno-cygwin -o dllexterns.o
dllexterns.cc
gcc -c -DBUILDING_DLL=1 -I. -I/mingw/include -g  -mno-cygwin -o dllinit.o
dllinit.c
dllwrap --export-all --output-def
cxxdll.def -mwindows -k --target=i386-mingw32 \
    --implib libcxx.dll.a --driver-name c++ -o cxxdll.dll \
    dllclass.o dllexterns.o dllinit.o -L/mingw/lib -s -mno-cygwin
Warning: no export definition file provided
dllwrap will create one, but may not be what you want
c++ -c -I. -I/mingw/include -g  -mno-cygwin -o usedll.o usedll.cc
c++ -o usedll.exe -g  -mno-cygwin  usedll.o -L./ -L/mingw/lib -lcxxdll
usedll.o: In function `main':
usedll.cc:30: undefined reference to `_imp___8DllClass$instances'
usedll.cc:30: undefined reference to `_imp__global_dllclass2'
usedll.cc:30: undefined reference to `_imp__global_dllclass2'
usedll.cc:30: undefined reference to `_imp___8DllClass$instances'
usedll.cc:30: undefined reference to `_imp__global_dllclass1'
usedll.cc:30: undefined reference to `_imp__global_dllclass1'
usedll.cc:30: undefined reference to `_imp__global_int_variable'
usedll.cc:38: undefined reference to `_imp___8DllClass$instances'
collect2: ld returned 1 exit status
make: *** [usedll.exe] Error 1


Several people have suggested various things on the mingw mailing list, but
so far I could not fix these errors. Any help would be greatly appreciated.

Thanks,
Vassili



--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Problem building DLLhelpers using Cygwin
  2000-07-18  9:17 Problem building DLLhelpers using Cygwin Vassili Sukharev
@ 2000-07-18 11:57 ` Charles Wilson
  0 siblings, 0 replies; 2+ messages in thread
From: Charles Wilson @ 2000-07-18 11:57 UTC (permalink / raw)
  To: Vassili Sukharev; +Cc: cygwin

It's possible some of the problems you are seeing were related to the
recent string of patches to binutils posted by DJ, me, and others.
Although there is not yet a cygwin package that contains these fixes,
you could try one of the following:

replace /usr/bin/ld.exe with the one here:
http://cygutils.netpedia.net/V1.1/linker/ld.exe.tar.gz (don't forget to
save a backup)

download the current binutils source from CVS
( http://sources.redhat.com/binutils/ ) and build the whole mess it
yourself -- this includes dlltool, ld.exe, et al. 

   ./configure --prefix=/usr --host=i686-pc-cygwin
--target=i686-pc-cygwin
   make
   make -n install
; note which files will be replaced and make backup copies
   make install

--Chuck


Vassili Sukharev wrote:
> 
> Hi All,
> 
> I need to build a dll with the cygwin gcc. As a starting point, I tried
> building a few dll examples, called dllhelpers, available from the following
> page:
> 
> http://www.nanotech.wisc.edu/~khan/software/gnu-win32/dllhelpers.html
> 
> There is a version for cygwin, which is supposed to be buildable without any
> adjustments to makefile. Upon typing make, the following happens:
> 
> c++ -c -DBUILDING_DLL=1 -I. -I/mingw/include -g  -mno-cygwin -o dllclass.o
> dllclass.cc
> c++ -c -DBUILDING_DLL=1 -I. -I/mingw/include -g  -mno-cygwin -o dllexterns.o
> dllexterns.cc
> gcc -c -DBUILDING_DLL=1 -I. -I/mingw/include -g  -mno-cygwin -o dllinit.o
> dllinit.c
> dllwrap --export-all --output-def
> cxxdll.def -mwindows -k --target=i386-mingw32 \
>     --implib libcxx.dll.a --driver-name c++ -o cxxdll.dll \
>     dllclass.o dllexterns.o dllinit.o -L/mingw/lib -s -mno-cygwin
> Warning: no export definition file provided
> dllwrap will create one, but may not be what you want
> c++ -c -I. -I/mingw/include -g  -mno-cygwin -o usedll.o usedll.cc
> c++ -o usedll.exe -g  -mno-cygwin  usedll.o -L./ -L/mingw/lib -lcxxdll
> usedll.o: In function `main':
> usedll.cc:30: undefined reference to `_imp___8DllClass$instances'
> usedll.cc:30: undefined reference to `_imp__global_dllclass2'
> usedll.cc:30: undefined reference to `_imp__global_dllclass2'
> usedll.cc:30: undefined reference to `_imp___8DllClass$instances'
> usedll.cc:30: undefined reference to `_imp__global_dllclass1'
> usedll.cc:30: undefined reference to `_imp__global_dllclass1'
> usedll.cc:30: undefined reference to `_imp__global_int_variable'
> usedll.cc:38: undefined reference to `_imp___8DllClass$instances'
> collect2: ld returned 1 exit status
> make: *** [usedll.exe] Error 1
> 
> Several people have suggested various things on the mingw mailing list, but
> so far I could not fix these errors. Any help would be greatly appreciated.
> 
> Thanks,
> Vassili
> 
> --
> Want to unsubscribe from this list?
> Send a message to cygwin-unsubscribe@sourceware.cygnus.com

--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2000-07-18 11:57 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-07-18  9:17 Problem building DLLhelpers using Cygwin Vassili Sukharev
2000-07-18 11:57 ` Charles Wilson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).