I
Ioannis Vranos
I compiled the hello world program, as specified in the current C++/CLI
draft (version 1.5), by using Visual C++ 2005 Express Beta 1:
int main()
{
System::Console::WriteLine("Hello World");
}
C:\c>cl /clr:safe temp.cpp
Microsoft (R) C/C++ Optimizing Compiler Version 14.00.40607.16
for Microsoft (R) .NET Framework version 2.00.40607.16
Copyright (C) Microsoft Corporation. All rights reserved.
temp.cpp
Microsoft (R) Incremental Linker Version 8.00.40607.16
Copyright (C) Microsoft Corporation. All rights reserved.
/out:temp.exe
temp.obj
==> The /clr:safe only produces an executable that passes peverify:
C:\c>peverify temp.exe /verbose
Microsoft (R) .NET Framework PE Verifier. Version 2.0.40607.16
Copyright (C) Microsoft Corporation. All rights reserved.
All Classes and Methods in temp.exe Verified.
C:\c>
Then wanting to test the binary portability of the produced executable,
I tried to run the produced executable as it is, in another CLI machine:
root@chrome cdrom]# mono temp.exe
** (temp.exe:1416): WARNING **: Could not find assembly
Microsoft.VisualC, references from /mnt/cdrom/temp.exe (assemblyref_index=1)
Major/Minor: 8,0
Build: 1200,0
Token: b03f5f7f11d50a3a
cannot open assembly temp.exe
[root@chrome cdrom]#
As it seems, MS introduces platform dependencies on the produced
executables, even for pure C++/CLI code.
How can I remove that useless assembly reference to "Microsoft.VisualC"?
Best regards,
Ioannis Vranos
draft (version 1.5), by using Visual C++ 2005 Express Beta 1:
int main()
{
System::Console::WriteLine("Hello World");
}
C:\c>cl /clr:safe temp.cpp
Microsoft (R) C/C++ Optimizing Compiler Version 14.00.40607.16
for Microsoft (R) .NET Framework version 2.00.40607.16
Copyright (C) Microsoft Corporation. All rights reserved.
temp.cpp
Microsoft (R) Incremental Linker Version 8.00.40607.16
Copyright (C) Microsoft Corporation. All rights reserved.
/out:temp.exe
temp.obj
==> The /clr:safe only produces an executable that passes peverify:
C:\c>peverify temp.exe /verbose
Microsoft (R) .NET Framework PE Verifier. Version 2.0.40607.16
Copyright (C) Microsoft Corporation. All rights reserved.
All Classes and Methods in temp.exe Verified.
C:\c>
Then wanting to test the binary portability of the produced executable,
I tried to run the produced executable as it is, in another CLI machine:
root@chrome cdrom]# mono temp.exe
** (temp.exe:1416): WARNING **: Could not find assembly
Microsoft.VisualC, references from /mnt/cdrom/temp.exe (assemblyref_index=1)
Major/Minor: 8,0
Build: 1200,0
Token: b03f5f7f11d50a3a
cannot open assembly temp.exe
[root@chrome cdrom]#
As it seems, MS introduces platform dependencies on the produced
executables, even for pure C++/CLI code.
How can I remove that useless assembly reference to "Microsoft.VisualC"?
Best regards,
Ioannis Vranos