Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Read these answered questions to understand the difference between Cygwin and MinGW.</p> <hr> <p>Question #1: I want to create an application that I write source code once, compile it once and run it in any platforms (e.g. Windows, Linux and Mac OS X…).</p> <blockquote> <p>Answer #1: Write your source code in JAVA. Compile the source code once and run it anywhere.</p> </blockquote> <hr> <p>Question #2: I want to create an application that I write source code once but there is no problem that I compile the source code for any platforms separately (e.g. Windows, Linux and Mac OS X …).</p> <blockquote> <p>Answer #2: Write your source code in C or C++. Use standard header files only. Use a suitable compiler for any platform (e.g. Visual Studio for Windows, GCC for Linux and XCode for Mac). Note that you should not use any advanced programming features to compile your source code in all platforms successfully. If you use none C or C++ standard classes or functions, your source code does not compile in other platforms.</p> </blockquote> <hr> <p>Question #3: In answer of question #2, it is difficult using different compiler for each platform, is there any cross platform compiler?</p> <blockquote> <p>Answer #3: Yes, Use GCC compiler. It is a cross platform compiler. To compile your source code in Windows use <strong>MinGW</strong> that provides GCC compiler for Windows and compiles your source code to native Windows program. Do not use any advanced programming features (like Windows API) to compile your source code in all platforms successfully. If you use Windows API functions, your source code does not compile in other platforms.</p> </blockquote> <hr> <p>Question #4: C or C++ standard header files do not provide any advanced programming features like multi-threading. What can I do?</p> <blockquote> <p>Answer #4: You should use POSIX (Portable Operating System Interface [for UNIX]) standard. It provides many advanced programming features and tools. Many operating systems fully or partly POSIX compatible (like Mac OS X, Solaris, BSD/OS and ...). Some operating systems while not officially certified as POSIX compatible, conform in large part (like Linux, FreeBSD, OpenSolaris and ...). <strong>Cygwin</strong> provides a largely POSIX-compliant development and run-time environment for Microsoft Windows.</p> </blockquote> <hr> <p>Thus:</p> <h2>To use advantage of GCC cross platform compiler in Windows, use MinGW.</h2> <h2>To use advantage of POSIX standard advanced programming features and tools in Windows, use Cygwin.</h2>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    1. COAbout your little faq: 1) Your right, if you need something that runs anywhere and doesn't need to be compiled choose something like java (also don't forget python, perl, ruby and the rest of the script languages) 2) This is somewhat wrong for the case of C, since all compilers of C, support it very well. 3) You can still use win32 api, but you have to wrap it in a portability layer, so that is only a design problem.
      singulars
    2. CO4) This is totally wrong, because of the reasons I give above, since POSIX is only other api, also if you defend so much POSIX, you should know that even Unices don't need to implement the same set of POSIX, so how do you deal with that? The real time POSIX api comes to mind. And that makes you conclusion completely bogus and wrong, because you don't need POSIX for anything in windows, you can just use the Win32 API. Or how do you think that Qt , GTK and WxWidgets have found a way to be cross-platform, I guess that they all have to use cygwin in windows. -1 vote for your answer.
      singulars
    3. COI don't understand your argument, @Coyote21. Are you saying that POSIX is unsuitable for cross-platform development? Are you saying that the only appropriate way to write code in C/C++ for multiple platforms is to write your own compatibility layer for each platform you wish to support? I don't see anything wrong with the suggestion to start with POSIX. You do need to see how far it can get you and whether an extensive compatibility layer solution will be required. Large compatibility layers are not the norm. To say otherwise is to argue that POSIX is a complete failure.
      singulars
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload