From: David E. <de...@us...> - 2007-01-03 20:04:24
|
Nilo Paim wrote: > ... > Unfortunately I've no access to a Linux box now... You are aware that to use SF CVS you will require some package which has SSH available, such as Putty. > ... >> Basically the export/import defines, and '.def' files are auto-generated >> by the MinGW compiler. > > Well, that's the problem... a Cobol program doesn't have generated the > GAS directives that permits the exporting of symbols... > > So, the MinGW compiler does not know what symbols to export... > ... > Well, I made some tests and modifications on my local copy... when I > call DLL's written in C or something like that it works like a charm, > without 'CALL-LOADLIB' extension. All my problems begins when I try to > call DLL's generated by TinyCobol... I'm able to find the DLL, but not > the sub-programs ( functions ), just because there are no functions > exported... > > Maybe should the compiler export all PROGRAM-ID's identifiers as > functions names, i. e, put the '.section .drectve' and '.ascii " > -export:prog-id-name"' clauses on generated code? > > Well, at least this is my first tough about... ;-) First we need to isolate the problem. What version of GCC (MinGW) are you using ? Have you tried to compile (using the Makefile.mingw) and run the examples found in t25 and t33 ? If these examples do not work, then we have a problem because they do work on GCC 3.x (MinGW). Regarding the export/import defines, the TC compiler does not generate any Win32 directives. The TC front end will spawn a process and let GCC worry about the details. So if you try using 'htcobol -v -m ...' command, TC should spawn a process with the equivalent command. gcc -shared \ -Wl,--out-implib,${lib_name2}.dll.a,--output-def,${lib_name2}.def \ -o ${SHARED_LIB} $(OBJS) ${LIBS} So the basic method for compile time linking is as follows. 1) Create the DLL(s) using the sub-programs. 2) Create the an object from the main-program. 3) Add the main object and library (DLL) to the link step using the '-ldll-name' GCC option. 4) Add the CWD to the path, and run the executable. Normally I recommend using make files for DLL's because of these complexities. And because when using the TC command line you can't create DLL's (modules) with multiple COBOL sources (htcobol -m s1.cob s2.cob). Anyway, have a look and let me know what you think. David Essex |