locked
Is it possible to port console apps to WinRT?

    Question

  • If I have a simple console app, e.g. #include <stdio.h> main(int argc, char *argv[]) {print("hello winrt world\n");} ... can I run this? I can't seem to find the options in VS to do this, which makes me suspect everything has to wrapped in metro.
    Saturday, October 13, 2012 4:05 AM

Answers

  • You'll need to port them to Windows Store apps. The error Visual Studio shows when you try to compile your app is accurate: Compiling Desktop applications for the ARM platform is not supported.

    --Rob

    • Marked as answer by Jesse Jiang Thursday, October 18, 2012 5:46 AM
    Tuesday, October 16, 2012 1:33 AM
    Owner

All replies

  • A nice question. It would be very much good to have a Windows RT device in which we can do programming too! I just add up a question; can we have a Metro Console App to meet the developers' needs?

    Abid

    Sunday, October 14, 2012 2:30 PM
  • It depends on what you mean by porting to WinRT and by wrapping in metro.

    You can use some Windows Runtime classes in console apps: look in the docs to see if the function applies to desktop apps as well as to Windows Store apps.

    Windows Store apps are inherently graphical and cannot use the console API. For simple tests it's fairly easy to handle the input graphically. For a real app you would want to add in a real graphical interface.

    --Rob


    Monday, October 15, 2012 3:14 AM
    Owner
  • It depends on what you mean by porting to WinRT and by wrapping in metro

    The original goal was to take some legacy C++ code written using the CRT, e.g.

    #include <stdio.h>
    main(int argc, char *argv[])
    {
        print("hello winrt world\n");
    }

    and compile to ARM and run as a standalone console app. I can't seem to find a way of building such a project for ARM.

    I have successfully placed the legacy code in a .lib and called from a simple WinStore UI, and that works, but I have 10 apps or so to port this way (test code only) and didn't really want to go through the hassle, given that the goal was not to actually publish the code.

    Thanks,

    Nick.

    Monday, October 15, 2012 8:43 PM
  • You'll need to port them to Windows Store apps. The error Visual Studio shows when you try to compile your app is accurate: Compiling Desktop applications for the ARM platform is not supported.

    --Rob

    • Marked as answer by Jesse Jiang Thursday, October 18, 2012 5:46 AM
    Tuesday, October 16, 2012 1:33 AM
    Owner
  • So how did MS built the Office 2013 ARM version if the compiler does not support this?

    I got the compiler to build ARM PE images (Just define _ARM_WINAPI_PARTITION_DESKTOP_SDK_AVAILABLE), yet running them gives an "invalid signature" error. Which signature does Windows RT accept? Any vaöie Root Authority signed code signing signature or only ones from MS?

    MSFT you are make porting Windows CE programs a real problem here!


    • Edited by phil_ke Tuesday, November 06, 2012 7:46 AM
    Tuesday, November 06, 2012 7:45 AM