консольное приложение c ++ на Raspberry Pi

594
yvi

как запустить консольное приложение VS2015 c ++ на raspberry pi 2. Я установил mono, скопировал файл .exe и попытался запустить его. Но он сказал: «Не удается открыть сборку abc.exe: файл не содержит допустимого образа CIL».

Я новичок в этом методе. Я не смог попробовать с VisualGDB, так как срок действия моей лицензии на трейл истек.

Этот метод правильный?

0
Как Mono .NET-компилятор связан с компиляцией приложения ARM C ++? Ramhound 8 лет назад 0

1 ответ на вопрос

0
gertmenkel

Mono can only run .NET applications. C++ applications are usually compiled to native (x86) code for Windows.

Windows code can sometimes be run on Linux using Wine, burbthis only works if the architecture the program was compiled for is the same as the one Linux runs on. Because the Raspberry Pi has an ARM processor, Wine is not an option here.

Mono doesn't have this limitation because .NET apps aren't compiled to native code, but to bytecode for use with the .NET framework (like Java does). This means .NET code can run on almost any processor architecture because the byte code ian't processor dependend.

This is why Mono can only run .NET code. If Mono can't execute your program, this is because it was not compiled to .NET code (or you used a library that isn't implemented in Mono, but that's very unlikely in this scenario).

Похожие вопросы