|
From: Uwe G. <ga...@do...> - 2002-01-15 17:11:17
|
(command lines at the end)
I want to compile and link a C-source provided as sample program by IBM to a
DLL what will be accessed by an application server. Because this program is
provided by IBM I think that all names and declarations are OK and that
there are no mistakes in the source itself.
I can compile the source without errors or warnings. The problem starts in
the link step.
First I tried to generate the DLL with Dev-C++. I got a lot of undefined
references because the libs provided by project options - in the contrary to
normal .exe files - were not included in the compilation process.
Second I copied the command lines from the Compile log of Dev-C++ and added
the libs. I got the error message
E:\DEV-C_~1\Bin\dllwrap: no export definition file provided
E:\DEV-C_~1\Bin\dllwrap: creating one, but that may not be what you want
but a DLL was generated. But this DLL had not the Export table required for
the application server. The .def file was obviously generated automatically
by dllwrap because Dev-C++ invokes dllwrap with the --output-def option.
In the past the programs for this application server were written with PL/1.
During the compilation of these programs a REXX programm generated the .def
file. The export table of the DLL had two entries:
Ordinal Entry Point Name
0000 ... <program name>
0001 ... FAA_PROGRAM_ID
In order to generate this export table the REXX program generated the
following .def file:
;Module definition file for CICS for Windows NT programs using PL/I
LIBRARY
EXPORTS ?<program name> @1
_FAA_PROGRAM_ID @2
When I invoke dllwrap with the --def option instead --output-def in order to
provide my own .def file (like the above) I get the error:
dc.s: Assembler messages:
dc.s:21: Warning: rest of line ignored; first ignored character is `?'
Cmnu.exp(.edata+0x34):fake: undefined reference to `'
Cmnu.exp(.edata+0x38):fake: undefined reference to `_FAA_PROGRAM_ID'
In order to find out the error more precisely I looked in the dllhelper file
in
http://www.nanotech.wisc.edu/%7Ekhan/software/gnu-win32/README.dllhelpers-0.
2.5.txt. I made the first invocation of gcc as described there and got no
errors or warnings. After the first invocation of the dlltool I got the
error message:
dc.s: Assembler messages:
dc.s:21: Warning: rest of line ignored; first ignored character is `?'
This is where my problem starts. Who can help me to create my DLL? BTW, I am
looking desperately for a tutorial explaining the link process and
especially the handling of base files, export and .def files (with gcc).
There is too much unclear to me. Following the command lines I invoked with
the last error message:
D:\CNT310\USERWRK\C\Source>E:\DEV-C_~1\Bin\gcc -c -DBUILDING_DLL=1 -I.
"d:\cnt310\userwrk\c\source\faaccmnu.c" -ggdb -IE:\DEV-C_~1\Include\ -IE:\
DEV-C_~1\Include\G__~1 -IE:\DEV-C_~1\Include\ -LE:\DEV-C_~1\Lib\ -BE:\DEV-C_
~1\Bin\ -ID:\CNT310\Tools\C\HEADER -ID:\CNT310\USERWRK\C\Header
D:\CNT310\USERWRK\C\Source>E:\DEV-C_~1\Bin\gcc -Wl,--base-file,faaccmnu.tmp
-mdll -Wl,-e,_DllMainCRTStartup@12 -o faaccmnu.dll
"d:\cnt310\userwrk\c\source\faaccmnu.o" D:\CNT310\Tools\LIB\FAAOTSCC.LIB
D:\CNT310\Tools\LIB\FAACLIB.LIB D:\CNT310\Tools\LIB\FAASR32.LIB
D:\CNT310\USERWRK\C\Source>dlltool --base-file faaccmnu.tmp --output-exp
faaccmnu.exp --def faaccmnu.def
dc.s: Assembler messages:
dc.s:21: Warning: rest of line ignored; first ignored character is `?'
And the file faaccmnu.def:
;Module definition file for CICS NT C/C++ program
LIBRARY
EXPORTS ?FAACCMNU @1
_FAA_PROGRAM_ID @2
Thank you for your help.
|