C# Native
От: SanyaVB  
Дата: 10.03.16 13:53
Оценка:
Кто пользовался Этим?

Вот такой код у меня не хочет компилироваться в native
using System;

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            Console.WriteLine("Hello, World!");
            Console.ReadKey();
        }
    }
}


Il2c.exe /exe Program.cs /corelib:CoreLib.dll /stubs

  output
Generating C file...Done.
Generating C file for the core library...Done.
Compiling C file for the core library...Done.
Compiling C file...Done.
Compiling target exe. file...Done.

Но чего-то exe файла я не нашел, только CoreLib.cpp, CoreLib.h, Program.cpp, Program.h

Решил скомпилировать руками следующей командой:

g++ -o helloworld.exe Program.cpp CoreLib.cpp -lstdc++ -lgc-lib -march=i686 -L .
  output
Program.cpp:118:7: warning: second argument of 'Int32 main(Int32, SByte**)' should be 'char **' [-Wmain]
Int32 main(Int32 count, SByte** parameters) {
^
CoreLib.cpp:133:1: warning: this decimal constant is unsigned only in ISO C90 [enabled by default]
UInt32 Microsoft_Win32_Win32Native_GENERIC_READ_CoreLib = 2147483648;
^
CoreLib.cpp:186:1: warning: this decimal constant is unsigned only in ISO C90 [enabled by default]
UInt32 Microsoft_Win32_Win32Native_SE_PRIVILEGE_USED_FOR_ACCESS_CoreLib = 2147483648;
^
CoreLib.cpp:192:1: warning: this decimal constant is unsigned only in ISO C90 [enabled by default]
UInt32 Microsoft_Win32_Win32Native_SE_GROUP_LOGON_ID_CoreLib = 3221225472;
^
CoreLib.cpp:304:1: warning: this decimal constant is unsigned only in ISO C90 [enabled by default]
UInt32 Microsoft_Win32_Win32Native_STATUS_NO_MEMORY_CoreLib = 3221225495;
^
CoreLib.cpp:305:1: warning: this decimal constant is unsigned only in ISO C90 [enabled by default]
UInt32 Microsoft_Win32_Win32Native_STATUS_OBJECT_NAME_NOT_FOUND_CoreLib = 3221225524;
^
CoreLib.cpp:306:1: warning: this decimal constant is unsigned only in ISO C90 [enabled by default]
UInt32 Microsoft_Win32_Win32Native_STATUS_NONE_MAPPED_CoreLib = 3221225587;
^
CoreLib.cpp:307:1: warning: this decimal constant is unsigned only in ISO C90 [enabled by default]
UInt32 Microsoft_Win32_Win32Native_STATUS_INSUFFICIENT_RESOURCES_CoreLib = 3221225626;
^
CoreLib.cpp:308:1: warning: this decimal constant is unsigned only in ISO C90 [enabled by default]
UInt32 Microsoft_Win32_Win32Native_STATUS_ACCESS_DENIED_CoreLib = 3221225506;
^
CoreLib.cpp:787:1: warning: this decimal constant is unsigned only in ISO C90 [enabled by default]
Int32 System_Decimal_SignMask = -2147483648;
^
CoreLib.cpp:845:1: warning: this decimal constant is unsigned only in ISO C90 [enabled by default]
Int32 System_Number_SCALE_NAN_CoreLib = -2147483648;
^
CoreLib.cpp:1722:1: warning: this decimal constant is unsigned only in ISO C90 [enabled by default]
Int32 System_Int32_MinValue = -2147483648;
^
CoreLib.cpp:1727:32: warning: integer constant is so large that it is unsigned [enabled by default]
Int64 System_Int64_MinValue = -9223372036854775808L;
^
CoreLib.cpp:1727:1: warning: this decimal constant is unsigned only in ISO C90 [enabled by default]
Int64 System_Int64_MinValue = -9223372036854775808L;
^
CoreLib.cpp:1999:1: warning: this decimal constant is unsigned only in ISO C90 [enabled by default]
UInt32 System_UInt32_MaxValue = 4294967295;
^
CoreLib.cpp:7511:1: warning: this decimal constant is unsigned only in ISO C90 [enabled by default]
Int32 System_IO_FileOptions_WriteThrough = -2147483648;
^
CoreLib.cpp:7539:1: warning: this decimal constant is unsigned only in ISO C90 [enabled by default]
Int32 System_IO_FileStream_GENERIC_READ = -2147483648;
^
CoreLib.cpp:8229:1: warning: this decimal constant is unsigned only in ISO C90 [enabled by default]
UInt32 System_Reflection_RuntimeAssembly_COR_E_LOADING_REFERENCE_ASSEMBLY = 2148733016;
^
CoreLib.cpp:9663:1: warning: this decimal constant is unsigned only in ISO C90 [enabled by default]
Int32 System_Threading_ManualResetEventSlim_SignalledState_BitMask = -2147483648;
^
CoreLib.cpp:9692:1: warning: this decimal constant is unsigned only in ISO C90 [enabled by default]
Int32 System_Threading_SpinLock_LOCK_ID_DISABLE_MASK = -2147483648;
^
CoreLib.cpp:9877:1: warning: this decimal constant is unsigned only in ISO C90 [enabled by default]
UInt32 System_Threading_Timer_MAX_SUPPORTED_TIMEOUT = 4294967294;
^
CoreLib.cpp:9882:1: warning: this decimal constant is unsigned only in ISO C90 [enabled by default]
UInt32 System_Threading_Timeout_UnsignedInfinite = 4294967295;
^
CoreLib.cpp:76411:5: warning: this decimal constant is unsigned only in ISO C90 [enabled by default]
if (value < -2147483648,5) goto a122;
^
CoreLib.cpp:76569:5: warning: this decimal constant is unsigned only in ISO C90 [enabled by default]
if (value >= 4294967295,5) goto a68;
^
CoreLib.cpp:237924:24: error: invalid suffix "f" on integer constant
if (loadFactor < 0,1f) goto a42;
^
CoreLib.cpp:237932:31: error: invalid suffix "f" on integer constant
(__this)->loadFactor = (0,72f * loadFactor);
^
CoreLib.cpp: In function 'Void Void_System_Array_InternalGetReferenceFVoidP__Int32__Int32PN(System_Array*, Void*, Int32, Int32*)':
CoreLib.cpp:21951:117: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
(&((System_TypedReference__struct_data*) array)->Type)->m_value = (Void*) (((System_ByteAY*) (__this))->typeCode);
^


И разумеется никакого helloworld.exe я не получил. Что я делаю не так??? Il2c.exe я брал из package_08012016.7z Т.е. самая свежая версия с их сайта(хоть и январская) в момент написание этого поста.
 
Подождите ...
Wait...
Пока на собственное сообщение не было ответов, его можно удалить.