Franks, thanks for taking my question.
I omitted the -c as suggested and now I'm getting a huge stream warnings about undefined references: $ gpc --automake MySource.p
gives dozens of warnings like:
C:/DOCUME~1/ghowes/LOCALS~1/Temp/ccEpaaaa.o(.text+0x92) : MySource.p : undefined reference to `_p__m8_MySource3_S27_Callpropertiesnull'
these are all methods in the .p files which are gathered together by the automake. I hadn't seen these undefined references on the Mac, but I'd been using the Mac libtool utility to gather together the .o files after the compile and generating a static library, not a DLL.
The .def file is created, as is the MySource.a file, but it seems to small as to have the libgpc linked into it (on my install libgpc.a is 278KB) while MySource.a is 354KB).
The .def file looks like this: EXPORTS Counter @1 DATA MyFunction @2 GPC_init @3 ...
So, should I be concerned about the undefined references? And if so, what can I do about it? And, how do I get from a .a file and a .def file to a Windows DLL?
On Jan 7, 2007, at 8:28 PM, Frank Heckenbach wrote:
Glenn Howes wrote:
I need to create a DLL which is loadable from a Visual Studio C++ application.
By analogy with the gcc command given in the MingW32 FAQ (http:// www.mingw.org/mingwfaq.shtml), I tried:
$ gpc -c --automake MySource.p -shared -o MySource.DLL -Wl, --ouput- def, MySource.def, --out-implib, MySource.a -lgpc
and the output is:
gpc.exe: --output-def: linker input file unused because linking not done gpc.exe: MySource.def: linker input file unused because linking not done gpc.exe: --out-implib: linker input file unused because linking not done gpc.exe: MySource.a: linker input file unused because linking not done
There must be no space after the commas after the "-Wl" options:
[...] -Wl,--output-def,MySource.def,--out-implib,MySource.a -lgpc
gpc.exe: -lgpc: linker input file unused because linking not done
The "-Wl" options are used only for linking, and "-c" tells GPC not to link. I don't know the full procedure (I don't use Windows), but perhaps just omit the "-c", or move the "-Wl" options to a later command (if there's one).
Frank
-- Frank Heckenbach, f.heckenbach@fh-soft.de, http://fjf.gnu.de/, 7977168E GPC To-Do list, latest features, fixed bugs: http://www.gnu-pascal.de/todo.html GPC download signing key: ACB3 79B2 7EB2 B7A7 EFDE D101 CD02 4C9D 0FE0 E5E8