Olivier Beaton | 27 Jun 01:01

Re: Problems building with MinGW

Newbie here,

Built a brand new Windows XP SP3 machine,
Installed
MinGW 5.1.4
MSYS 1.0.10
msysDTK 1.0.1
python 2.5.2
expat 2.0.1 (built from source)

which gives me:
autoconf 2.56
automake 1.7.1
g++ 3.4.5
libtool 1.4e

trying to build log4cxx 0.10.0, which depends on expat, apr, apr-util.
Went to build apr from SVN HEAD today 2008-06-26, fails to build
(sorry I can't copy + paste the log from a non-internet machine)
Tried to build the lot with ant (provided by log4cxx) and apr builds
but apr-util doesn't.

From there I went bleeding edge with the 4.x g++ on mingw site and
still couldn't get past apr.  I've spent 2 days now trying different
configurations (even mingwPORT libtool!) to no luck, perhaps I just
haven't hit the perfect combination yet.  I've tried using sources on
the websites for download or direct from SVN HEAD.

From the messages by people like Bob Rossi and Curt Arnold it looks
like this is a frequent problem.
(Continue reading)

Bob Rossi | 27 Jun 01:28

Re: Problems building with MinGW

On Thu, Jun 26, 2008 at 07:01:03PM -0400, Olivier Beaton wrote:
> trying to build log4cxx 0.10.0, which depends on expat, apr, apr-util.
> Went to build apr from SVN HEAD today 2008-06-26, fails to build
> (sorry I can't copy + paste the log from a non-internet machine)
> Tried to build the lot with ant (provided by log4cxx) and apr builds
> but apr-util doesn't.

Did you folow the isntructions?

http://wiki.apache.org/logging-log4cxx/MSWindowsBuildInstructions

I currently build log4cxx, apr and apr-util. Although, my log4cxx
version is a little old.

Bob Rossi

Olivier Beaton | 27 Jun 02:47

Re: Problems building with MinGW

Hi Bob,

I'm honoured you've taken the time to forward me that link.  The short
answer is that I have indeed tried that build over the last few days,
but I'm desperate, so as a long answer, I'll do it now and log all my
info bellow.

I've researched this problem thoroughly despite my limited knowledge,
and would really appreciate any tips you could give me.

Attempt #1 "Try to stay Latest"

Windows XP SP3

MinGW 5.1.4 (installed to C:\MinGW)
- base
- g++ compiler
- mingw make
http://sourceforge.net/project/showfiles.php?group_id=2435&package_id=240780

MSYS Base 1.0.10 (installed to C:\MSYS and mounting /mingw)
http://sourceforge.net/project/showfiles.php?group_id=2435&package_id=24963

MSYS DTK 1.0.1
http://sourceforge.net/project/showfiles.php?group_id=2435&package_id=67879

Python 2.5.2
http://www.python.org/download/

CppUnit 1.12.1
(Continue reading)

Bob Rossi | 27 Jun 03:25

Re: Problems building with MinGW

On Thu, Jun 26, 2008 at 08:47:44PM -0400, Olivier Beaton wrote:
> Hi Bob,
> 
> I've researched this problem thoroughly despite my limited knowledge,
> and would really appreciate any tips you could give me.

I'm sure we can get this working, I'll even try the latest release of 
apr, apr-util, and log4cxx for you.

> Attempt #1 "Try to stay Latest"
> 
> Windows XP SP3

Same here.

> MinGW 5.1.4 (installed to C:\MinGW)
> - base
> - g++ compiler
> - mingw make
> http://sourceforge.net/project/showfiles.php?group_id=2435&package_id=240780
> 
> MSYS Base 1.0.10 (installed to C:\MSYS and mounting /mingw)
> http://sourceforge.net/project/showfiles.php?group_id=2435&package_id=24963
> 
> MSYS DTK 1.0.1
> http://sourceforge.net/project/showfiles.php?group_id=2435&package_id=67879
> 
> Python 2.5.2
> http://www.python.org/download/
> 
(Continue reading)

Bob Rossi | 27 Jun 03:38

Re: Problems building with MinGW

> /bin/sh /home/quadir/apr/libtool --silent --mode=compile gcc   -O0 -s
> -mms-bitfields -march=i686 -DHAVE_CONFIG_H -D_LARGEFILE64_SOURCE
> -I./include -I/home/quadir/apr/include/arch/win32
> -I./include/arch/unix -I/home/quadir/apr/include/arch/unix
> -I/home/quadir/apr/include  -o dso/win32/dso.lo -c dso/win32/dso.c &&
> touch dso/win32/dso.lo
> In file included from
> C:/msys/1.0/home/quadir/apr/include/arch/win32/apr_arch_file_io.h:29,
>                  from dso/win32/dso.c:20:
> C:/msys/1.0/home/quadir/apr/include/arch/win32/apr_arch_misc.h:419:
> error: syntax error before "LPPROCESSENTRY32W"
> C:/msys/1.0/home/quadir/apr/include/arch/win32/apr_arch_misc.h:419:
> error: syntax error before "LPPROCESSENTRY32W"
> C:/msys/1.0/home/quadir/apr/include/arch/win32/apr_arch_misc.h: In
> function `apr_winapi_Process32FirstW':
> C:/msys/1.0/home/quadir/apr/include/arch/win32/apr_arch_misc.h:419:
> error: `hSnapshot' undeclared (first use in this function)
> C:/msys/1.0/home/quadir/apr/include/arch/win32/apr_arch_misc.h:419:
> error: (Each undeclared identifier is reported only once
> C:/msys/1.0/home/quadir/apr/include/arch/win32/apr_arch_misc.h:419:
> error: for each function it appears in.)
> C:/msys/1.0/home/quadir/apr/include/arch/win32/apr_arch_misc.h:419:
> error: `lppe' undeclared (first use in this function)
> C:/msys/1.0/home/quadir/apr/include/arch/win32/apr_arch_misc.h: At top level:
> C:/msys/1.0/home/quadir/apr/include/arch/win32/apr_arch_misc.h:428:
> error: syntax error before "LPPROCESSENTRY32W"
> C:/msys/1.0/home/quadir/apr/include/arch/win32/apr_arch_misc.h:428:
> error: syntax error before "LPPROCESSENTRY32W"
> C:/msys/1.0/home/quadir/apr/include/arch/win32/apr_arch_misc.h: In
> function `apr_winapi_Process32NextW':
(Continue reading)

Olivier Beaton | 27 Jun 04:39

Re: Problems building with MinGW

Thank you for taking the time to check it out Bob.

I've been pulling my hair out for 3 days over this.  I'm a bit
masochistic in that I wanted current to work (instead of just
backdating everything to some known working date, which is complicated
as the whole environment has to be backdated)

fyi with current MinGW/MSYS/MSYSDTK,

apr1.3.2, apr1.3.1, apr1.3.0 all failed in the same way.

apr1.2.9 fails with "decision on anonymous shared memory allocation
method failed"
but a post indicates I need crypt installed for this problem
http://mail-archives.apache.org/mod_mbox/tcl-rivet-dev/200212.mbox/%3CD981925B4F2CD611870300E0184CEE9B6E63FD <at> kaiserslautern1.lms-gmbh.de%3E
However the binary package wouldn't get detected by configure
(resulting in the same error) and despite installing bash and lndir to
compile crypt from the mingw source and applying the patch by hand I
got stuck in make.

Needless to say, I don't think I'll be able to get apr to compile (and
move on to seeing about apr-util, apr-iconv/libiconv and then finally
log4cxx!) until upstream is fixed.

Thanks for doing that work, I'll sit tight.

On 6/26/08, Bob Rossi <bob_rossi <at> cox.net> wrote:
>  > C:/msys/1.0/home/quadir/apr/include/arch/win32/apr_arch_misc.h:428:
>  > error: `lppe' undeclared (first use in this function)
>  > make[1]: *** [dso/win32/dso.lo] Error 1
(Continue reading)

Dale King | 27 Jun 13:16

Re: Problems building with MinGW

Do you really need it to be built with MinGW or are you just building
under MinGW because the out of date build instructions on the Wiki
tell you to do that?

If you are using Visual Studio for your application it's a heck of a
lot easier to just build with Visual Studio. You can use the pre-built
binaries for APR instead of building them yourself.

I can send you my vcproj files if you would rather go that route.

The wiki build instructions should really be updated to reflect how to
build with visual studio.

--

-- 
Dale King

Olivier Beaton | 27 Jun 16:19

Re: Problems building with MinGW

Not to worry Dale,  there are already instructions for building with VC
http://logging.apache.org/log4cxx/building/vstudio.html
and they work rather well, I used them just the other day (took about
5 minutes to build log4cxx).

The project I am involved in is built both on linux and on windows,
using gcc g++ mingw on windows, and gcc g++ on linux.  Our IDE is
eclipse CDT on both operating systems.  We only use cross-platform
libraries, like boost, xercesc, and hoping to use log4cxx.

So there are advantages to using a non-windows specific toolchain, the
problem here was that apr was broken at the moment for the windows
version of that toolchain (mingw).

Olivier Beaton

Dale King | 27 Jun 16:35

Re: Problems building with MinGW

On Fri, Jun 27, 2008 at 10:19 AM, Olivier Beaton
<olivier.beaton <at> gmail.com> wrote:
> Not to worry Dale,  there are already instructions for building with VC
> http://logging.apache.org/log4cxx/building/vstudio.html

I was referring to the Wiki page with instructions for building on
Windows which have no instructions for Visual Studio:

http://wiki.apache.org/logging-log4cxx/MSWindowsBuildInstructions

> and they work rather well, I used them just the other day (took about
> 5 minutes to build log4cxx).

I would say those instructions are a little overboard as I see no
reason to build APR when you can download the pre-built binaries and
link with them.

> The project I am involved in is built both on linux and on windows,
> using gcc g++ mingw on windows, and gcc g++ on linux.  Our IDE is
> eclipse CDT on both operating systems.  We only use cross-platform
> libraries, like boost, xercesc, and hoping to use log4cxx.
>
> So there are advantages to using a non-windows specific toolchain, the
> problem here was that apr was broken at the moment for the windows
> version of that toolchain (mingw).

So there is a reason for MinGW.

--

-- 
Dale King
(Continue reading)

Amit Gokani | 27 Jun 16:49

RE: Problems building with MinGW


Hi,

I am new to this forum and was looking an example of code that uses the log4cxx libraries. I am running a VC
application as a service that needs to generate a log file with debug messages in a particular directory.

I have built the log4cxxx libraries and included them in my application. The code compiles fine albeit lots
of warning messages and then tried to implement the below worked example but all that happens is that the
application crashes.

Thanks,
Amit

main.cpp
----------
#include <log4cxx/logger.h>
#include <log4cxx/xml/domconfigurator.h>
#include <log4cxx/helpers/exception.h>
#include <iostream>

int main(int argc, char **argv)
{
    try
    {
        log4cxx::LoggerPtr logger(log4cxx::Logger::getLogger("main"));
        log4cxx::xml::DOMConfigurator::configure("log4cxx.xml");
        LOG4CXX_DEBUG(logger, "Debug message");
        LOG4CXX_INFO(logger, "Info message");
        LOG4CXX_WARN(logger, "Warn message");
        LOG4CXX_ERROR(logger, "Error message");
(Continue reading)


Gmane