Re: [ooc-compiler] Foreign module compilation
Brought to you by:
mva
|
From: Frank H. <fh...@ph...> - 2004-05-27 17:15:58
|
Tim Teulings wrote:
> So you try to use your FOREIGN module as application main module?
> Possibly oo2c canot handle it. Try to make a separate, "normal" module
> that imports your FOREIGn module and use that as program module.
Did that and reduced all files to a minimum. Now my actual directory
contains an executable module test.Mod which imports the foreign module
Serial.Mod, the implementation of which is Serial.c:
test.Mod:
---------
MODULE test;
IMPORT Serial;
BEGIN Serial.Open ("1");
END test.
Serial.Mod:
-----------
MODULE Serial [FOREIGN "C"; LINK FILE "Serial.c" END];
PROCEDURE Open* (p:CHAR);
END Serial.
Serial.c:
---------
#include <Serial.oh>
/* run-time meta data */
static RT0__ModuleDesc _mid;
static RT0__ModuleDesc _mid = { (OOC_CHAR8*)"Serial", (RT0__Struct[]) {
NULL } };
extern void OOC_Serial_init0() {
RT0__RegisterModule(&_mid);
OOC_Serial_init();
}
/* --- */
#include <__oo2c.h>
#include <setjmp.h>
#include <stdio.h>
void Serial__Open(OOC_CHAR8 p) {
printf("Open!\n");
return;
;
}
void OOC_Serial_init(void) {
return;
;
}
/* --- */
"oo2c -AMv test.Mod" gets me:
------------------------------------
- /usr/local/lib/oo2c/pkginfo.xml
- sym/test.Sym
- /usr/local/lib/oo2c/sym/RT0.Sym
- /usr/local/lib/oo2c/sym/Object.Sym
- /usr/local/lib/oo2c/sym/HashCode.Sym
- /usr/local/lib/oo2c/sym/Exception.Sym
- sym/Serial.Sym
gcc -O2 -I/usr/local/include -DGC_WIN32_THREADS
-I/usr/local/lib/oo2c/src -Iobj -I/usr/local/lib/oo2c/obj
-c /Documents and Settings/Frank/Documents/Test/Serial.c
-o obj/Serial.o
gcc: cannot specify -o with -c or -S and multiple compilations
-------------------------------------
I allways get such a gcc error message, whether I compile with or
without -A, upon compilation of test.Mod as well as Serial.Mod.
Still any idea?
-----------------------------------------------------------
Frank Hrebabetzky Tel.: +55/48/239-2258
Photonita Ltda Fax: +55/48/239-2200
Parque Tec. Alfa - Ed. CELTA
Florianopolis, SC
88030-000
Brasil
|