------------------------------------------------- MinGW gcc 3.x Native Installation Under Windows ------------------------------------------------- Leor Zolman updated 11/24/03 The MinGW32 build of gcc 3.x finally comes in the form of a Win32 self-installer, making it easy to install the gcc 3.x compiler natively (sans Cygwin) under Windows. However, it is not entirely obvious how to use extended containers (hash_set, slist, etc.) after the installation, so this document tells one way to do it: 1. Download and install the software from: http://www.mingw.org/index.shtml The file you'll want to download is named MinGW-x.x.x-x.exe, in the Current/MinGW section. Alternatively, you can download and install the Dev-C++ distribution, which contains gcc integrated into it, from http://www.bloodshed.net/dev/ 2. Add the installation's bin directory to your system PATH 3. To use extended containers (hash_set, hash_multiset, hash_map, hash_multimap and slist), you must a) Copy the required header files (I just copy hash_map, hash_set and slist) from the include\c++\3.X\ext directory in your gcc hierarchy to its parent (the 3.X directory). Note that in the Dev-c++ distribution, the directory to copy from is include\c++\ext and you'll copy into the c++ directory. In Dev-C++, instead of copying the files you can just make sure the path of the "ext" directory is configured in the compiler options "C++ includes" section. You may skip this if you prefix these header filenames with "ext/" in all of your #include statements, but I find source compatibility is easier to maintain when there are no directory prefixes to deal with. b) Yank in the namespace __gnu_cxx. Here's a way to do it that maintains source compatibility with other platforms (e.g. Comeau, MSVC 7, gcc 2.95.2): #if defined(__GNUC__) && __GNUC__ == 3 using namespace __gnu_cxx; #endif 4. If you want to use STL error decryption (super-distilled version of the information in QUICKSTART.txt from my gcc-specific STL Error Decryptor): a) Install ActivePerl (www.activestate.com) b) In your gcc installation's bin directory, make a copy of "c++.exe" named "c++2.exe". c) edit gfilt.bat (from the Decryptor package) to properly locate your gSTLFilt.pl file (also from the package) d) put gfilt.bat somewhere in your PATH e) to compile foobar.cpp, say: gfilt foobar.cpp (it will create a.exe). For more flexibility, install the "Proxy c++" as described in the Decryptor package.