fatal error C1001: INTERNAL COMPILER ERROR

G

Guest

I'm getting an internal compiler error from Visual C++ .NET 2003 when I'm using managed extensions. Here is the error.

Generating Code...
c:\development\icu\source\common\uhash.c(869) : fatal error C1001: INTERNAL COMPILER ERROR (compiler file 'f:\vs70builds\3077\vc\Compiler\Utc\src\P2\main.c', line 148)
Please choose the Technical Support command on the Visual C++
Help menu, or open the Technical Support help file for more information

I think the problem is due to the assignment of a returned union to another union. If I change uhash.c line 869 from

result = _uhash_internalRemoveElement(hash, e);
to
_uhash_internalRemoveElement(hash, e);

That specific error goes away, but then I get this error messege.

uhash.obj : fatal error LNK1235: corrupt or invalid COFF symbol table


Here are the steps to reproduce the problem.

1) Download the ICU 3.0 open source project from http://oss.software.ibm.com/icu/download/3.0/index.html
2) unzip ICU
3) Open icu\source\allinone\allinone.sln
4) Change the properties on the common project to use managed extensions
5) Build ICU

Any ideas as to what the problem might be? This code works on many other non-Windows platforms, but it can't be built with managed extensions.
 
G

Guest

I hope I'm not barking up the wrong tree here, but ...

There are no Unions in .NET, but you can use [StructLayout(LayoutKind::Explicit)] and [FieldOffset] to simulate them, for example you can do the following

[StructLayout(LayoutKind::Explicit)]
__value class LargeInteger
{
public:
[FieldOffset(0)] int lowPart;
[FieldOffset(4)] int highPart;
[FieldOffset(0)] __int64 quadPart;
};
 
G

Guest

If that were true, I'd expect a real error messege to tell me so, instead of
an internal compiler error.

Besides, since there is syntax in .NET to do exactly the same thing that you
specified, I'd expect the union keyword to get translated into the correct
syntax.

I'd expect it to translate it into something like the following:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/html/cpconunionssample.asp

Thank you for the suggestion anyway.

George
(hoping to hear more barking)
 
G

Guest

If that were true,

It is true.
I'd expect a real error messege to tell me so, instead of
an internal compiler error.

I expect presents on my birthday ... maybe that's why I get none :blush:(
Besides, since there is syntax in .NET to do exactly the same thing that you
specified, I'd expect the union keyword to get translated into the correct
syntax.

I'd expect it to translate it into something like the following:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/html/cpconunionssample.asp

but this link shows how YOU could implement a union in managed code, and it
shows how YOU could use the unmanaged code from within managed code.
Thank you for the suggestion anyway.

You are welcome.

maybe, if it is at all plausible, you should declare the problem structure
with __nogc ...

#pragma unmanaged
// compile with /EHsc to enable unmanaged exception handling
__nogc union MYUNION
{
int i;
double d;
}
#pragma managed

etc.

I don't know about barking, but this one could be considered howling ...

billr
 
G

Guest

I tried your suggestion (even the C equivalent), but that didn't build in C.

I also changed the union to a struct, and that gave me the same compiler
errors.

So I doubt this problem is happening because of the union.
 
G

Guest

George said:
I tried your suggestion (even the C equivalent), but that didn't build in C.
I also changed the union to a struct, and that gave me the same compiler
errors.
So I doubt this problem is happening because of the union.

Shame, it would have been nice if it was something so simple that I could
figure out :blush:(

I hope someone else pops in with a suggestion.
Good luck George :blush:)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top