MinGW compiler

EagleKeeper

Discussion Club Moderator<br>Elite Member
Staff member
Oct 30, 2000
42,589
5
0
I need guidance :(
VC++ is not POSIX complient and does not support the opendir, closedir, readdir, etc funcitons.

I need to create a program that is not tied into the Windows OS that can manipulate the directory structures.

I have installed the compiler on a Windows 7 system.

Need clues on where to go since then.
I have been spoiled by using IDE on Unix, Linux or Windows since day 0.

I can write the source code in Notepad if I have to, or is there a IDE that will allow me to code, compile and debug with the MinGW.

Or, is there a different free package that I can install under Windows that will solve my headaches.

Without the IDE; can one point me to a tutorial on how to actually use the MinGW compiler.

TIA

EK
 
Last edited:

Cogman

Lifer
Sep 19, 2000
10,286
145
106
Just a note, Mingw is POSIXish. It isn't really the full posix standard and there in nothing in there that prevents you from putting no-cross platform compatible code in. It was built to be a GCC compiler for windows.

If you really REALLY want something that is completely posix standardified, cygwin is the way to go. Just be aware that cygwin is big and a little slower on windows.

Now for the IDE. I personally like netbeans and code::blocks for my C++ development. I'm not a huge fan of eclipse, but it will still work for you.

While you can't easily use MingW in visual studios, you can actually use Clang (GCC alternative based on the LLVM) in visual studios http://clang.llvm.org/get_started.html . You get the added bonus that Clang is currently the most compliant C++11 compiler out there.
 

EagleKeeper

Discussion Club Moderator<br>Elite Member
Staff member
Oct 30, 2000
42,589
5
0
thanks guys.

I ended up using Ultra_edit as the editor. They have an advance option that allowed me to activate the compiler for mingw.

No debugger - amazing what cout and cin will do :)

I will examine the options that others provided in the thread to see what I may feel comfortable with
 

TheRyuu

Diamond Member
Dec 3, 2005
5,479
14
81
QTCreator is probably the best gui for debugging not-msvc compiled stuff on Windows from what I've messed around with (remember you don't have to use the compiler qtcreator ships with to use it's debugging feature, just something compiled with -g). It's probably the best GUI/IDE that isn't msvc for C/C++ stuff. There is GDB for mingw (if you were implying there wasn't).

A sane mingw toolchain can be found here:
http://xhmikosr.1f0.de/tools/

Specifically:
MSYS_MinGW-w64_GCC_471_x86-x64.7z
or
MSYS_MinGW-w64_GCC_471_x86-x64_Full.7z

Being "sane" in this case means --disable-shared and something which just works. You can get into dll hell real fast with the shared mingw runtime files.

Both i686 and x86_64 toolchains use mingw-w64 (which is the way it should be, vanilla mingw is virtually depreciated in favor of mingw-w64), default target (host) is i686. Yes it won't be truly POSIX but you also won't be dragging the cygwin baggage around either. It depends what you want to do with it. I don't know if it applies at all in your situation but it is possible to link to mingw compiled static libs in msvc (it's just not exactly easy, and probably not possible with any of the mingw versions linked in this post).

GDB for mingw can be found here (I don't know why the above doesn't come with it considering all the stuff it does have):
http://tdm-gcc.tdragon.net/download
 
Last edited:

esun

Platinum Member
Nov 12, 2001
2,214
0
0
This may be asking for trouble, but just so you know you could also use a 3rd party cross-platform library for these things, e.g.:

http://www.boost.org/doc/libs/1_50_0/libs/filesystem/doc/index.htm

You should then be able to compile in VC++ and in gcc or mingw and it should work (in theory, of course). But if you haven't worked with boost before there is some overhead in understanding how their libraries work.
 

EagleKeeper

Discussion Club Moderator<br>Elite Member
Staff member
Oct 30, 2000
42,589
5
0
This may be asking for trouble, but just so you know you could also use a 3rd party cross-platform library for these things, e.g.:

http://www.boost.org/doc/libs/1_50_0/libs/filesystem/doc/index.htm

You should then be able to compile in VC++ and in gcc or mingw and it should work (in theory, of course). But if you haven't worked with boost before there is some overhead in understanding how their libraries work.

The concern I had with using Boost is that it may not be compatible across OS.

I was able to resolve the problem and now have the luxury of experimenting with other's suggestions.