Copyright@ belongs to the author. For any re-post of this article, a reference to the original link under wholehope.wordpress.com is required.

Install MinGW for windows

Use Installer

Follow the link for instructions.
http://www.mingw.org/wiki/HOWTO_Install_the_MinGW_GCC_Compiler_Suite

1. Download Installer
2. Edit path environment variable.  My Computer -> Advanced -> System -> Edit

But this method is claimed to be unmaintained.

Manually Install

1. Download files according to
http://www.mingw.org/wiki/Getting_Started
2. Use 7-zip to unzip lzma file to tar file
3. Use WinRAR to extract files “to here”;
4. Pay attention when prompted to replace the file with the newest version
5. Also install dbg and make

First Compiling

http://www.mingw.org/wiki/MinGWforFirstTimeUsers

Basic Howto
http://www.mingw.org/wiki/HOWTO

Install MSys

If we want to compile some released package,such as gloox, we need install MSys as well to get a minimal unix environment to run the make process.

1. Follow the step to install MSys
http://www.mingw.org/wiki/MSYS

For the broken link of MSYS Core 1.0.11, use this one instead:
http://sourceforge.net/projects/mingw/files/MSYS%20Base%20System/msys-1.0.11/msysCORE-1.0.11-bin.tar.gz/download

2. Make sure to set HOME environment as instructed;
3. There should be a Cyan Icon on the desktop for MSYS;
4. Click the icon to enter simulated unix environment

Use MSys to make Gloox in Windows

5.  cd d:
6.  cd yourdirectory/gloox-1.0
7.  ./configure –with-schannel

if you miss the flag, you might get the link errors like:
.libs/clientbase.o: .\gloox-1.0\src/clientbase.cpp:707: undefined reference to `FreeCredentialsHandle@4′

rerun configure with the correct flag.

Do not try to fix the flags manually.
Follow the link here to fix the problem. Do not recommend. Might take a long time. Use the first method.
http://camaya.net/glooxlist/dev/msg01123.html
add new flags “-ldnsapi -lcrypt32 -lsecur32” to /gloox-1.0/Makefile and /gloox-1.0/src/Makefile
This is a bad way since there are other makefiles in test directory.

8. For gloox-1.0, two files in /src/example/ need to be modified to include <time.h>

rf_send.cpp rf_recv.cpp
Otherwise, there is compiling error
ft_send.cpp:146: error: ‘ctime’ was not declared in this scope

9. make

If you get this error message:
g++.exe: c:/MinGW/lib/gcc/mingw32/4.4.0/libstdc++.dll.a: No such file or directory

This is a known issue of mingw, follow the solution here.
———————————————————————————————–
http://www.mail-archive.com/openbabel-devel@lists.sourceforge.net/msg00048.html
To solve it:
edit the file /mingw/lib/gcc/mingw32/4.4.0/libstdc++.la
to remove (or comment out) the line:
library_names=’libstdc++.dll.a’

Hope this helps,
Igor
———————————————————————————————–