Re: [ooc-compiler] Interface mod.: undef. ref. to win32 API proc.
Brought to you by:
mva
|
From: Tim T. <ra...@ed...> - 2004-05-25 20:22:50
|
Hallo!
> Doing my first steps with oo2c under MinGW, I wrote an interface module=
=20
> which begins like this:
>=20
> MODULE IFserial [INTERFACE "C"; LINK LIB "kernel32" END];
>=20
> and which contains:
>=20
> PROCEDURE CreateFile*
> (name:ARRAY OF LONGCHAR;
> accessMode,shareMode:SET;
> secAttr:lpSecAttr; create,attr:DWORD; template:HANDLE
> ): HANDLE;
>=20
> This module is imported by another one, "Serial.Mod". Both compile, but=
=20
> the linker produces an error message:
>=20
> obj/Serial.o(.text+0x8d):Serial.c: undefined reference to `CreateFile=
'
I'm not sure, that the function is contained in kernel32? What about user=
32?
If you try to access Windows functions there is no need to write=20
interface modules for it, since VisualOberon already contains a=20
Windows.Mod that should contain most of the Window functions, structures =
etc...
It module sequence starts with (note the "Pascal"):
MODULE Windows [ INTERFACE "Pascal";
LINK LIB "kernel32"; LIB "user32"; LIB "gdi32" END];
See VisualOberon homepage and CVS repository for details.
--=20
Gru=DF...
Tim.
|