Dec 5, 2011

log4cpp compile on Windows with MinGW and Usage in NetBeans 7.1RC1

Just for testting, I attempted to use NetBeans 7.1RC1 on Windows with MinGW-Compiler.

I installed to MinGW installer, which was getting everything from the Web.

In NetBeans the Compiler must be configured by adding the MinGw/bin Path as base directroy.

Creating a new project still fails, because I had also to add
C:\MinGW\msys\1.0\bin to the PATH envrionment to find mkdir, which is used in
the makefiles of a C++ Project in NetBeans, otherwise the build fails.

log4cpp can be downloaded starting from here.

Starting a bash and using configure --prefix=/c/sdk/log4cpp/1.0 started the configure and
afterwards a make attempted to compile the source, but there are some problems.

I found the solution by a nice guy Zih Jun on his blog.

After some modifications in the log4cpp source, it could be compiled, although there was
a problem with dirname in the configure step.

After doing a make install all necessary things were copied.

In the Project-Options of NetBeans, I added the include path.

But the code completion just showed some files.

The reason therefore ist, that NetBeans doesn't recognise  header files with the extension .hh which
log4cpp is using.

Adding hh to the extensions showed all headers.

Now the real learing starts, how to use log4cpp.