Oberon Community Platform Forum
November 23, 2017, 09:59:39 AM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: error: object with array constructor in an external dll  (Read 1977 times)
fnecati
Jr. Member
**
Posts: 60


« on: September 15, 2010, 10:09:56 AM »

Hi,

if Azn module is compiled to Azn.dll library with:

mono ~/bin/zc.exe /out:Azn Azn.znn

and testAzn module is compiled to exe with Azn.dll using as refrence

mono ~/bin/zc.exe /ref:Azn.dll /out:testAzn /entry:testAzn testAzn.znn

the following error is arises:

Zonnon Compiler, Version 1.2.8.0 of Friday, August 06, 2010, 10:20:04 PM
(c) 2003-2009 ETH Zurich
2117: /home/necati/Mycsharp/testAzn.znn(19,8): Illegal argument type(s) for 'MyObj' constructor. Expected
Zonnon.Azn+MyObj(System.Double[] _x0)
2072: /home/necati/Mycsharp/testAzn.znn(19,2): Types 'variable' and 'not expression' are not assignment compatible

The same type errors also arises if any object with any array type constructor exists in a dll library compiled with C#.

if these modules are compiled together with:
    mono ~/bin/zc.exe /out:testAzn /entry:testAzn Azn.znn testAzn.znn
the compilation is completed successfully.

if this Azn.dll is used in C# program, the compilation is also succesfull.

What is wrong here ?

Code:
module Azn;
(*
mono ~/bin/zc.exe /out:Azn Azn.znn
*)

import
System;

type {public}
     DoubleArray = array * of real;

type {public,ref} MyObj=object(x0: DoubleArray)
     var {public}
        x: DoubleArray;

 begin
  x := x0;
 end MyObj;

end Azn.


Code:
module testAzn;
import
System,
Azn,
Azn.MyObj as MyObj;
 
 type
(*       DoubleArray = Azn.DoubleArray;*)
     DoubleArray = array * of real;

var
    da: DoubleArray;
    o2: MyObj;
begin

 da := new DoubleArray(3);
 da[0] := 1.0; da[1] := 2.0; da[2] := 3.0;

 o2 := new MyObj(da);

end testAzn.

Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.21 | SMF © 2015, Simple Machines Valid XHTML 1.0! Valid CSS!