dotgnu-general
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Mercury ILDasming was ([DotGNU]Mercury on Portable.NET (not successf


From: Fergus Henderson
Subject: Re: Mercury ILDasming was ([DotGNU]Mercury on Portable.NET (not successful))
Date: Mon, 3 Mar 2003 12:56:52 +1100
User-agent: Mutt/1.3.28i

On 02-Mar-2003, James Michael DuPont <address@hidden> wrote:
> I get only these errors :
> address@hidden@?$AA@ : multiply defined

This one is a definition which is generated by MSVC++.Net for a C string
literal (the empty string, as it happens) which is used in two different
C++ files in the Mercury standard library sources.

> _fltused : multiply defined

This one is because the Mercury compiler emits

        extern "C" int _fltused=0;

in every C++ file that we generate.

In both of these cases, it works fine if each file is compiled to its own
DLL, because each DLL has its own scope, but naturally you will get multiple
definition errors if you try to link them all into a single executable.

The reason why we made the Mercury compiler emit definitions of
`_fltused' was to work around a bug in early beta versions of MSVC++.NET.
It is probably not needed anymore.  I will test this and if it is not
needed I will modify the Mercury compiler to not emit those anymore.

The use of C string literals is also unnecessary and undesirable --
all we are using them for is to construct .NET strings, so we might
as well use the .NET string literal syntax (S"..."), rather than
using C string literals and then converting them to .NET strings.
I think that too was originally done to work around a bug in an early
beta version of MSVC++.NET.  I will modify the Mercury standard library
sources to avoid that.

> a.out.exe: no entry point specified

The entry point should be hello.mercury_code.main_2;
it is in hello.exe in the original.

I think the problem here is just that in your script

>       echo 'ildasm -q $1 > $1.il' > dasm.sh 
>       for x in *.dll; do sh ./dasm.sh $x; done
>       for x in *.dll.il; do ilasm $x; done
>       ilalink  *.dll.obj

you missed the ".exe" file.  It should be

        echo 'ildasm -q $1 > $1.il' > dasm.sh 
        for x in *.exe *.dll; do sh ./dasm.sh $x; done
        for x in *.exe.il *.dll.il; do ilasm $x; done
        ilalink  *.exe.obj *.dll.obj

-- 
Fergus Henderson <address@hidden>  |  "I have always known that the pursuit
The University of Melbourne         |  of excellence is a lethal habit"
WWW: <http://www.cs.mu.oz.au/~fjh>  |     -- the last words of T. S. Garp.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]