# installing mingw

This topic is 2092 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

containing some mingw things (gcc, headers, libs, some

documentation?)

I am using 32 bit Xp I would like tu use this mainly for

win32 coding ..

I got a modem connection with very limited transfer

(need something at most 40MB)

I found something like

http://tdm-gcc.tdragon.net

(I mean the first of it 29.3MB) not downloaded yet.. Would it be ok?

Is there any other option compiler for my murpose (small (< 50MB IMPORTANT), good, free to any use, c/c++ win32/64compiler (need basic c++ only) that could be used here? Mingw seem to be okay for me though it has AFAIK this ugly asembly syntax i still do not like)

Edited by fir

##### Share on other sites

If you only use basic C++ without classes then maybe you can use C to get a smaller compiler.

The tiny C compiler (TCC) don't support C++ but is very small (Below 2MB with examples and everything).

##### Share on other sites

If you only use basic C++ without classes then maybe you can use C to get a smaller compiler.

The tiny C compiler (TCC) don't support C++ but is very small (Below 2MB with examples and everything).

I am writing c, yea, except that there is this f** thing that in c you cannot use const like here

const int tab_max = 1000;

char tab[tab_max];

(you can only use

#define tab_max 1000

char tab[tab_max];

i dislike defines,

this is disaster (should be changed (tell them!)) so i only use c++ to compile otherwise pure c-like code

Edited by fir

##### Share on other sites

I am writing c, yea, except that there is this f** thing that in c you cannot use const like here

...

Turn on c99 mode when you compile, it's great.

##### Share on other sites

I am writing c, yea, except that there is this f** thing that in c you cannot use const like here

...

Turn on c99 mode when you compile, it's great.

I was speaking about c99, afaik i cannot use const like here

(EDIT sorry maybe I am mistaken (not sure I was checking this but now i am not sure if this was c90 or c99))

EDIT EDIT no, i was right it do not compile

Edited by fir

##### Share on other sites

You can use const in C, but the rules are a bit different when it comes to consts inside a struct and probably some other areas I'm not thinking about. Definitely look into the c99 and c11 (-std=c11) flags if you are stuck using C instead of C++.

For the assembly language syntax in gcc, you should be able to use -masm=intel for Intel syntax instead of AT&T syntax.

On the compiler front, mingw is going to be the safest bet. If you want more descriptive compiler warnings/errors, CLang is useful on that front (performance still has a few bad corner cases though). Both are probably over your 50 MB limit though.

If you aren't comfortable compiling tools from source, I'd recommend against mingw-w64 or TDM-gcc unless you actually need to build 64-bit executables. They are far less commonly used than mingw, and it can be a bit annoying to find precompiled binaries compatible with your specific version if you're missing a certain tool or whatever. Not too annoying of course, but a pointless waste of time if you don't need x64.

##### Share on other sites

If you aren't comfortable compiling tools from source, I'd recommend against mingw-w64 or TDM-gcc unless you actually need to build 64-bit executables. They are far less commonly used than mingw, and it can be a bit annoying to find precompiled binaries compatible with your specific version if you're missing a certain tool or whatever. Not too annoying of course, but a pointless waste of time if you don't need x64.

Actually, the mingw-w64 project is interesting, whether you care about x64 or not. MinGW is a very safe compiler, but also very boring. It takes relatively long to get new versions of gcc and its standard library. It's also missing all of std::thread so far.
The mingw-w64 project on the others hand offers more recent builds of gcc (the last time I checked 4.8.2 versus 4.7.x) as well as a complete standard library (including std::thread). To be fair, mingw-w64 explicitly states their complete standard library is not as efficient as it could be (because it works over posix primitives instead of ones native to Windows), which is why they offer two versions (one with std::thread and one more efficient without).

While you have to build some libraries yourself when using mingw-w64 instead of MinGW, most libraries are not pre-built for non-MSVC anyway so you don't have to build much more either way. Also, Qt5 for example is only pre-built for mingw-w64 (although the bundled version is 4.8.0 instead of the newest available), not for other flavours.

##### Share on other sites

You can use const in C, but the rules are a bit different when it comes to consts inside a struct and probably some other areas I'm not thinking about. Definitely look into the c99 and c11 (-std=c11) flags if you are stuck using C instead of C++.

For the assembly language syntax in gcc, you should be able to use -masm=intel for Intel syntax instead of AT&T syntax.

const int table_max = 1000;
char table[table_max];

with -std=c99 and this not compile

main.c:8: variable-size type declared outside of any function

(defines works but i will not use defines)
this is a terrible problem for me but i can do nothing only can switch compilation to c++

For the assembly language syntax in gcc, you should be able to use -masm=intel for Intel syntax instead of AT&T syntax.

On the compiler front, mingw is going to be the safest bet. If you want more descriptive compiler warnings/errors, CLang is useful on that front (performance still has a few bad corner cases though). Both are probably over your 50 MB limit though.

finaly i changed my mind abit about this 50MB boundary (up to 100MB - though still i prefer tools <30MB)

throw out codeblocks (prefer smaller editors) but will keep mingw

If you aren't comfortable compiling tools from source, I'd recommend against mingw-w64 or TDM-gcc unless you actually need to build 64-bit executables. They are far less commonly used than mingw, and it can be a bit annoying to find precompiled binaries compatible with your specific version if you're missing a certain tool or whatever. Not too annoying of course, but a pointless waste of time if you don't need x64.

now i do notr need it but will like to learn x64 assembly and

stuff (next year or 2016 or something like that), but okay thank for advice i agree with that

Edited by fir

##### Share on other sites

Just allocate the memory dynamically and it should work, just make sure to call delete [] afterward and i will work just fine. (or malloc/free in c)

ex.

const int tab_max = 1000;

char *tab = (char*)malloc(tab_max);

...

free(tab);


If you're afraid to make a leak by using this kind of code often, consider encapsulating it in a class, call free in the destructor, problem solved.

You can find lots of "abandonware" here for free, like old and very small compilers.

Edited by Vortez

##### Share on other sites

const int table_max = 1000;
char table[table_max];

with -std=c99 and this not compile

main.c:8: variable-size type declared outside of any function

(defines works but i will not use defines)
this is a terrible problem for me but i can do nothing only can switch compilation to c++

You can do that declaration inside of a function, just not at global scope. You can even remove the const qualifier. It will rely on variable length arrays.

Consts in C are more like read-only variables than actual consts. Basically, C assumes you'll take the address of a const and actually modify it. A compiler is only allowed to treat a const like you might expect if the compiler confirms you never use the address of the const.

Actually, the mingw-w64 project is interesting, whether you care about x64 or not. MinGW is a very safe compiler, but also very boring. It takes relatively long to get new versions of gcc and its standard library. It's also missing all of std::thread so far.

The mingw-w64 project on the others hand offers more recent builds of gcc (the last time I checked 4.8.2 versus 4.7.x) as well as a complete standard library (including std::thread). To be fair, mingw-w64 explicitly states their complete standard library is not as efficient as it could be (because it works over posix primitives instead of ones native to Windows), which is why they offer two versions (one with std::thread and one more efficient without).

While you have to build some libraries yourself when using mingw-w64 instead of MinGW, most libraries are not pre-built for non-MSVC anyway so you don't have to build much more either way. Also, Qt5 for example is only pre-built for mingw-w64 (although the bundled version is 4.8.0 instead of the newest available), not for other flavours.

Very interesting to know. I've been using mingw-w64 by necessity for a while, so I suppose my knowledge about mingw proper is a bit outdated. Thanks for the info.

Minor note: mingw-builds has mingw-w64 binary bundles with gcc 4.8.2-seh, Qt 5.2.0, Qt Creator 3.0.0 (450 MB). The compiler without Qt is about 50 MB though.

• ### Game Developer Survey

We are looking for qualified game developers to participate in a 10-minute online survey. Qualified participants will be offered a \$15 incentive for your time and insights. Click here to start!

• 18
• 33
• 9
• 16
• 22