Allegro.cc - Online Community

Allegro.cc Forums » Programming Questions » What is "MinGW" and what is "MSVC?"

Credits go to bamccaig and Speedo for helping out!
This thread is locked; no one can reply to it. rss feed Print
What is "MinGW" and what is "MSVC?"
Felix-The-Ghost
Member #9,729
April 2008
avatar

Now I think MSVC is Microsoft Visual...C...
and I looked and MinGW has something to to with windows as well;
if I use these for windows does it make the code nonportable?
I use DevCpp and I think I recall it saying it was MinGW,
these terms are new to me and I just hope my programs aren't just for windows.
I was going to install the logg ogg vorbis library and it said it was for MinGW, does this mean only windows can run it?

==========================
<--- The ghost with the most!
---------------------------
[Website] [Youtube]

X-G
Member #856
December 2000
avatar

Why don't you try using Google before you ask questions like that?

--
Since 2008-Jun-18, democracy in Sweden is dead. | 悪霊退散!悪霊退散!怨霊、物の怪、困った時は ドーマン!セーマン!ドーマン!セーマン! 直ぐに呼びましょう陰陽師レッツゴー!

bamccaig
Member #7,536
July 2006
avatar

MSVC does in fact refer to the Microsoft Visual C++ IDE/development tools. MinGW is Minimalist GNU for Windows. Both are collections of tools for Windows, meaning the binaries built using them will be for Windows only (unless you can cross-compile... I've never done it, I don't know). However, the source code itself doesn't have to be compiler nor platform specific. Writing cross-platform code is possible regardless of what compiler you're using, usually with the help of preprocessor directives or pre-written APIs that do the cross-platform work themselves. The Allegro library, for example, is cross-platform; and can be compiled with a number of compilers depending on which platform you're on (Windows, Linux, etc.).

Wikipedia could have at least helped to answer your question, so like X-G said, don't be afraid to do a little searching first. I find that typically the URL http://wikipedia.org/wiki/<Entity_name> is pretty successful in finding what you're looking for (where spaces in <Entity_name> are replaced with underscores and usually the first character is capitalized). And if it's not, you're usually given a link to search for what you're looking for, in which case it will usually come up pretty easily (assuming what you're looking for is well known).

Speedo
Member #9,783
May 2008

Quote:

if I use these for windows does it make the code nonportable?

That depends entirely on the code you write. For example these two Hello World programs do exactly the same thing... the first can be compiled for any platform, the second only works on windows:

1#include <iostream>
2 
3int main( ) {
4 std::cout << "Hello World!" << std::endl;
5 return 0;
6}
7 
8---------------------
9 
10#include <windows.h>
11 
12int main( ) {
13 int written;
14 HANDLE hStdOut = GetStdHandle(STD_OUTPUT_HANDLE);
15 WriteConsole(hStdOut, L"Hello World!", 12, &written, 0);
16 return 0;
17}

Felix-The-Ghost
Member #9,729
April 2008
avatar

Okay thanks guys, see I did look on google, and that's why I freaked out because I saw the keyword Windows and I automatically thought Windows only So I had to find out quick.
I actually didn't think about using wikipedia :P
go ahead and delete this topic if you want :P

==========================
<--- The ghost with the most!
---------------------------
[Website] [Youtube]

Milan Mimica
Member #3,877
September 2003
avatar

When you compile it for Windows, the executable is Windows only. It has nothing to do with the code though.

GullRaDriel
Member #3,861
September 2003
avatar

Quote:

go ahead and delete this topic if you want :P

I never saw a topic deleted there, so be warned and mind what you write before posting ;-)

"Code is like shit - it only smells if it is not yours"
Allegro Wiki, full of examples and articles !!

X-G
Member #856
December 2000
avatar

Quote:

I never saw a topic deleted there

Unless it was deleted before you ever had a chance to see it, of course...

--
Since 2008-Jun-18, democracy in Sweden is dead. | 悪霊退散!悪霊退散!怨霊、物の怪、困った時は ドーマン!セーマン!ドーマン!セーマン! 直ぐに呼びましょう陰陽師レッツゴー!

GullRaDriel
Member #3,861
September 2003
avatar

I did not say that no answer were ever deleted, as our supreme dictator had me in sight of his sniping weapon some few month ago.

"Code is like shit - it only smells if it is not yours"
Allegro Wiki, full of examples and articles !!

Trezker
Member #1,739
December 2001
avatar

You can run some windows binaries on other platforms using wine. Though wine 1.1 seems to have some problems with the msvc*.dll files... So I recommend using Mingw.

nonnus29
Member #2,606
August 2002
avatar

Quote:

I actually didn't think about using wikipedia

This should be your first instinct: think of something you don't know, and fill in the gap from wikipedia. Strong AI will arise when wikipedia can be piped into the human brain :o

Arthur Kalliokoski
Second in Command
February 2005
avatar

The first program compiled in Linux won't run on Windows either. Java supposedly runs on any OS, but you need OS specific code (interpreter, JIT compiler, whatever) to make it do that.

“Throughout history, poverty is the normal condition of man. Advances which permit this norm to be exceeded — here and there, now and then — are the work of an extremely small minority, frequently despised, often condemned, and almost always opposed by all right-thinking people. Whenever this tiny minority is kept from creating, or (as sometimes happens) is driven out of a society, the people then slip back into abject poverty. This is known as "bad luck.”

― Robert A. Heinlein

Tobias Dammers
Member #2,604
August 2002
avatar

Quote:

This should be your first instinct: think of something you don't know, and fill in the gap from wikipedia. Strong AI will arise when wikipedia can be piped into the human brain

I'm currently learning the entire wikipedia by heart, but those bastards keeps changing it all the time.

OT: If the quality of your software is about the same level as your knowledge of programming tools, the internet, and computers in general, then cross-platformness is the last thing you need to worry about right now.
To clarify things for you a bit:
- What you write is source code, probably in C or C++. These languages are standardized, and work the same on all platforms. This means that the pure language part (the syntax) is automatically cross-platform.
- Since the C and C++ language specifications do not include any higher-level APIs, you need libraries to do common tasks like displaying graphics, reading user input, opening network connections, etc. etc. etc. Many of these are cross-platform, others aren't. Allegro is, the Windows API is not. Virtually all C implementations come with libc (the C standard library), and C++ generally comes with STL (the Standard Template Library).
- Once you have written your code, you compile it into machine code (binaries). For this, you need a compiler. Since different platforms generally use different binary formats, and often different machine languages, the resulting binaries are not usually compatible across platforms.

---
Me make music: Triofobie
---
"We need Tobias and his awesome trombone, too." - Johan Halmén

Go to: