locked
Can Visual C++ 2010 Express Edition compile cross-platform applications? RRS feed

  • Question

  • Or should I use a cross-platform IDE such as Code::Blocks or Dev-C++?
    Tuesday, May 10, 2011 8:45 PM

Answers

  • If your goal is to write portable code, then just start writing portable code and compile/debug in the target platform.

    Yes you can write the custom build rules/make file project to use a compiler that targets another platform. I use Visual C++ to write perl scripts and intel assembly code and compile/assemble the code using make file. But if you don't use Visual Studio's debugger and compiler, I am not sure the editor/project system/source control integration alone is attractive enough to justify the time and effort to set up the environment.



    The following is signature, not part of post
    Please mark the post answered your question as the answer, and mark other helpful posts as helpful, so they will appear differently to other users who are visiting your thread for the same problem.
    Visual C++ MVP
    • Marked as answer by lucy-liu Tuesday, May 17, 2011 8:36 AM
    Tuesday, May 10, 2011 9:49 PM

All replies

  • The IDE has nothing to do with cross-platform code.  The code itself has to be cross-platform.  The compiler, however is the one you need to focus on.  99% sure that the compiler provided with Visual Studio produces Windows-only executables.  If you want to produce output for other platforms, get compilers for those platforms.
    MCP
    Tuesday, May 10, 2011 8:58 PM
  • So I don't have to replace VC++ with another IDE?

    What compiler should I get and how do I set VC++ to use it?

    Tuesday, May 10, 2011 9:01 PM
  • I don't know those answers, sorry.  I am a Windows groupie. :-)  But search the web!  See http://tinyurl.com/66kszqz, second result.  Looks like an interesting list.  They DO sin by calling "compilers" all those IDE's, but surely will be helpful.

    Can Visual Studio be set up to use a different compiler?  VERY good question.  I don't know.  Let's see if someone else knows.


    MCP
    Tuesday, May 10, 2011 9:11 PM
  • If your goal is to write portable code, then just start writing portable code and compile/debug in the target platform.

    Yes you can write the custom build rules/make file project to use a compiler that targets another platform. I use Visual C++ to write perl scripts and intel assembly code and compile/assemble the code using make file. But if you don't use Visual Studio's debugger and compiler, I am not sure the editor/project system/source control integration alone is attractive enough to justify the time and effort to set up the environment.



    The following is signature, not part of post
    Please mark the post answered your question as the answer, and mark other helpful posts as helpful, so they will appear differently to other users who are visiting your thread for the same problem.
    Visual C++ MVP
    • Marked as answer by lucy-liu Tuesday, May 17, 2011 8:36 AM
    Tuesday, May 10, 2011 9:49 PM
  • Yes, VC++ can compile cross platform applications... if the other platform is Windows CE or WinPhone.

    --pa

     

    Tuesday, May 10, 2011 10:38 PM
  • hehe, good one Pavel. :-)

     

    Sheng, you did set up the environment.  Was the editor/Project system/source control integration worth the trouble for you?


    MCP
    Tuesday, May 10, 2011 10:53 PM
  • Yes, because I remember all the shortcut keys... I edit much faster in the Visual Studio editor.

    The following is signature, not part of post
    Please mark the post answered your question as the answer, and mark other helpful posts as helpful, so they will appear differently to other users who are visiting your thread for the same problem.
    Visual C++ MVP
    Wednesday, May 11, 2011 12:51 AM