Re: [ooc-compiler] Interface mod.: undef. ref. to win32 API proc.
Brought to you by:
mva
|
From: Frank H. <fh...@ph...> - 2004-05-26 15:42:28
|
Tim Teulings wrote: > Hallo! > >> Doing my first steps with oo2c under MinGW, I wrote an interface >> module which begins like this: >> >> MODULE IFserial [INTERFACE "C"; LINK LIB "kernel32" END]; >> >> and which contains: >> >> PROCEDURE CreateFile* >> (name:ARRAY OF LONGCHAR; >> accessMode,shareMode:SET; >> secAttr:lpSecAttr; create,attr:DWORD; template:HANDLE >> ): HANDLE; >> >> This module is imported by another one, "Serial.Mod". Both compile, >> but the linker produces an error message: >> >> obj/Serial.o(.text+0x8d):Serial.c: undefined reference to `CreateFile' > > > I'm not sure, that the function is contained in kernel32? What about > user32? Win32-SDK-Help says it is in kernel32. I installed dumpbin and had a look at the exports of kernel32.dll and what I found is a procedure "CreateFileA". I made the changes and now it links. Nevertheless it is odd, because I did some tests before with mingw/gcc and from my C program I called "CreateFile" and it worked. > > If you try to access Windows functions there is no need to write > interface modules for it, since VisualOberon already contains a > Windows.Mod that should contain most of the Window functions, structures > etc... With respect to VisualOberon I have some questions but I guess it is better to open a separate thread. So hold on ... > 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. > ----------------------------------------------------------- Frank Hrebabetzky Tel.: +55/48/239-2258 Photonita Ltda Fax: +55/48/239-2200 Parque Tec. Alfa - Ed. CELTA Florianopolis, SC 88030-000 Brasil |