On Saturday 03 November 2007, DJ Delorie wrote:
> In Windows, you have to create an import library to link
> against. Look for a program called "dlltool" (or
> mingw-dlltool); it should have options for reading a DLL and
> creating a suitable .a to link against.
>
> Alternately, you should be able to list the dll as a regular
> library (I don't know if the -lfoo syntax works), and the
> linker will synthesize the import library for you.
>
I'm still confused.
In the dlltool man page, it gives an example:
=========
gcc -c dll.c
dlltool -e exports.o -l dll.lib dll.o
gcc dll.o exports.o -o dll.dll
gcc program.o dll.lib -o program
=========
(it's actually i586-mingw32msvc-gcc, and so on,
but that is a non-issue)
[EMAIL PROTECTED]:/tmp/al>i586-mingw32msvc-g++ -c foo.cc
[EMAIL PROTECTED]:/tmp/al>i586-mingw32msvc-dlltool -e exports.o -l foo.lib foo.o
[EMAIL PROTECTED]:/tmp/al>i586-mingw32msvc-g++ foo.o exports.o -o foo.dll
foo.o:foo.cc:(.text+0x7): undefined reference to `bar()'
/usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/../../../../i586-mingw32msvc/lib/libmingw32.a(main.o):(.text+0x85):
undefined reference to [EMAIL PROTECTED]'
collect2: ld returned 1 exit status
ok ... the first two steps seem to work, but not the third.
The fourth is not practical because the program
cannot know about the dll. It knows an interface,
but nothing else. It cannot know which dll's will
be used, or how many of them.
> Note that the "will be resolved later" stuff is different
> with DLLs; check google to see if it's even possible to do
> lasy resolution (find "bar" after the program loads, so that
> the program's bar is called). You might have to hand-edit an
> import description file and use it to build an import library
> for that one symbol.
In the real file, there are hundreds of symbols needing
lazy resolution. There are also hundreds of dll's being built.
The program can not know anything about the dll's,
other than the calling mechanism, which is really C++
virtual functions, with a dispatcher. It is working great
on Linux now.
Are you telling me that Windows cannot do lazy resolution?
_______________________________________________
geda-dev mailing list
[email protected]
http://www.seul.org/cgi-bin/mailman/listinfo/geda-dev