--- Tor Lillqvist <tml@...> wrote: > Gisle Vanem writes:
> > I'm having problems with building an EXE that should export
> > various functions for some plugin DLLs to use.
> > Is there some ld switch to do what I want? Or must I mark all exports with
> > __declspec(dllexport) and use a .def file and dlltool?
> If I recall correctly, you need to both decorate the exported
> functions with __declspec(dllexport), and link with an .exp file. The
> .exp file is generated with dlltool from the .o file(s) generated from
> the file(s) containing the dllexport decorated function
> definitions. When linking the executable include the .exp file, like
> if it was an object file.
That's one way.
An easier way is to just mark the exports with __declspec((dllexport)) in exe src
/* exe.c */
int __attribute__ ((dllexport))
printf ("This output produced by ExportedFromExe.\n");
printf ("Hello, world\n");
and compile like so:
gcc -o exe.exe -Wl,--out-implib,libexe.a exe.c
Do _not_ use -shared or -mdll, otherwise the base address will be that of a dll.
Instead of using __declspec (dllexport) in source, you could use def file,
and add to list of objects:
gcc -o exe.exe -Wl,--out-implib,libexe.a exe.def exe.c
Find local movie times and trailers on Yahoo! Movies.