[fpc-pascal]c -> fpc
Peter Beisel
beisel at kbprueftechnik.frm.de
Mon Mar 4 10:16:01 CET 2002
Hi all,
I need your help!
Compiler: FPC 1.0.4
Target: GO32V2
I want to link some librarys generated by a 32bit c-compiler
(target: DOS) to my FPC programs.
1. WatCom
Neither the *.LIB nor the *.OBJ files generated by WatCom are
accepted from the FP linker. Is there any way to make them
usable?
2. DJGPP
The *.o files generated by DJGPP are accepted from the FP linker
and the generated EXE-file executes quite well.
BUT: the *.o file represents only the code of the one module.
Example:
DJGPP:
test.h:
long aFunc()
test.c:
long aFunk()
{
return 4711
}
compile: test.o
FPC:
Testo.PAS:
program Testo;
uses crt;
{l test.o}
function aFunc: longint; cdecl; external;
begin
writeln( aFunc);
end.
Compile, link, run: output: 4711 - very well.
You see this little module needs nothing else. All it's code is
represented by it's o-File (test.o). If test.c needs other modules
their code is not represented in test.o. You need to link to this
other modules too. But if there is a reference to a library, there
is no object file that represents the code of the library. You have
to bind a library yourself. And now you are at the point:
How can a library generated by DJGPP linked into a FPC program ??
-----------------------------------------------------------------
Regards, Peter
More information about the fpc-pascal
mailing list