CALOI ROBERTO MARIA | 12 Jun 10:23

Log4cxx with VisualC++ 2008 Express Edition - Release issue

Hello,

I’m having a runtime crash when using the release version of Log4cxx.

This case seems very similar to the FAQ #2 (“My application on Windows crashes on shutdown”) where it is suggested to use the same type of C Runtime library.

 

My project is called prova3.sln with the following source

 

#include <iostream>

 

#include "log4cxx/logger.h"

#include "log4cxx/basicconfigurator.h"

#include "log4cxx/helpers/exception.h"

 

using namespace log4cxx;

using namespace log4cxx::helpers;

 

LoggerPtr logger(Logger::getLogger("MyApp"));

 

int main(int argc, char **argv)

{

        int result = EXIT_SUCCESS;

        try

        {

                // Set up a simple configuration that logs on the console.

                BasicConfigurator::configure();

 

                LOG4CXX_INFO(logger, "Entering application.");

                LOG4CXX_INFO(logger, "Exiting application.");

        }

        catch(Exception&)

        {

                result = EXIT_FAILURE;

        }

      std::cout << "Hello!" << std::endl;

            //char c=std::cin.get();

 

        return result;

}

 

DEBUG (Runtime library setting)

The program runs fine if I build the debug version by using:

Prova3.exe : Multi-threaded DLL Debug (/MDd)

Log4cxx.dll: Multi-threaded DLL Debug (/MDd)

Apr-1.lib: Multi-threaded Debug (/MTd)

Aprutil-1.lib: Multi-threaded Debug (/MTd)

Expat.dll: Multi-threaded DLL Debug (/MDd)

(I had to build expat.lib separately to solve some “unresolved references” I got while building the aprutil.sln project).

 

RELEASE (Runtime library setting)

The program crashes at exit if I build the release version by using:

Prova3.exe : Multi-threaded DLL(/MD)

Log4cxx.dll: Multi-threaded DLL(/MD)

Apr-1.lib: Multi-threaded(/MT)

Aprutil-1.lib: Multi-threaded(/MT)

Expat.dll: Multi-threaded DLL(/MD)

 

Is there any problem in using static apr-1 and aprutil-1 to build log4cxx .dll?

I tried to build apr and aprutil with the /MD option too, then I got the same runtime error.

 

Does anybody have any idea on where I’m wrong?

 

Thanks

 

Roberto

 

 

 

 



Le informazioni contenute in questo messaggio di posta elettronica sono riservate, rivolte esclusivamente al destinatario e non comportano alcun vincolo ne' creano obblighi per la societa' mittente, salvo che cio' non sia espressamente previsto da un precedente accordo.
Ogni altra persona diversa dal destinatario non puo' copiare o consegnare il presente messaggio o parte dello stesso a terzi ne' trattare in alcun modo i dati contenuti. La informiamo inoltre che l'utilizzo non autorizzato del messaggio o dei suoi allegati potrebbe costituire reato.

Grazie per la collaborazione.

The informations in this e-mail are are reserved, only addressed to the addressee and they are neither binding on this Society nor to be understood as creating any obligation on its part except where provided for an agreement.
Everyone different from the addressee (who received this e-mail) can't neither copy nor deliver the message or a part of it in possesion of a third party, nor even deal with the informations in this e-mail. Furthermore the unauthorized use of this message or any attachments could be an offence.

Thank you for your cooperation.
CALOI ROBERTO MARIA | 12 Jun 13:22

Log4cxx with VisualC++ 2008 Express Edition - Release issue

“I tried to build apr and aprutil with the /MD option too, then I got the same runtime error.”

 

Nooo.. It works! (Simply a didn’t replaced the old dll with the new one..)

In the meantime I found the following blog http://www.dreamcubes.com/blog/?itemid=43.

It could have saved me a lot of effort.

 

The only question I still have is:

xmltok_impl.c

xmltok_ns.c

aren’t included in the VC++6 project debug version, while they are included in the release version.

I had to exclude them to build the release version too. Is that correct?

I also had to rename expat.h.in to expat.h.

 

 

 

Thanks a lot to the developers of log4cxx.

 

Roberto

 

 



Le informazioni contenute in questo messaggio di posta elettronica sono riservate, rivolte esclusivamente al destinatario e non comportano alcun vincolo ne' creano obblighi per la societa' mittente, salvo che cio' non sia espressamente previsto da un precedente accordo.
Ogni altra persona diversa dal destinatario non puo' copiare o consegnare il presente messaggio o parte dello stesso a terzi ne' trattare in alcun modo i dati contenuti. La informiamo inoltre che l'utilizzo non autorizzato del messaggio o dei suoi allegati potrebbe costituire reato.

Grazie per la collaborazione.

The informations in this e-mail are are reserved, only addressed to the addressee and they are neither binding on this Society nor to be understood as creating any obligation on its part except where provided for an agreement.
Everyone different from the addressee (who received this e-mail) can't neither copy nor deliver the message or a part of it in possesion of a third party, nor even deal with the informations in this e-mail. Furthermore the unauthorized use of this message or any attachments could be an offence.

Thank you for your cooperation.
Jacob L. Anawalt | 12 Jun 17:58

Re: Log4cxx with VisualC++ 2008 Express Edition - Release issue

CALOI ROBERTO MARIA wrote:
> In the meantime I found the following blog http://www.dreamcubes.com/blog/?itemid=43.
> It could have saved me a lot of effort.
> 

If you have a moment, perhaps you can add to the MS Developer Studio build 
section of the wiki and include a link to that blog along with some of the more 
important notes in case the blog goes away?

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

--

-- 
Jacob Anawalt
Gecko Software, Inc.
janawalt <at> geckosoftware.com
435-752-8026

CALOI ROBERTO MARIA | 18 Jun 10:52

RE: Log4cxx with VisualC++ 2008 Express Edition - Release issue

I see the blog's owner (Merc) is posting here, so I think he's the right person to update the wiki section :-)
Let's say I'm a newbie, but I'll try if I can...

> -----Original Message-----
> From: Jacob L. Anawalt [mailto:janawalt <at> geckosoftware.com]
> Sent: Thursday, June 12, 2008 5:58 PM
> To: Log4CXX User
> Subject: Re: Log4cxx with VisualC++ 2008 Express Edition -
> Release issue
>
> CALOI ROBERTO MARIA wrote:
> > In the meantime I found the following blog
> http://www.dreamcubes.com/blog/?itemid=43.
> > It could have saved me a lot of effort.
> >
>
> If you have a moment, perhaps you can add to the MS Developer
> Studio build section of the wiki and include a link to that
> blog along with some of the more important notes in case the
> blog goes away?
>
> http://wiki.apache.org/logging-log4cxx/MSWindowsBuildInstructions
>
>
> --
> Jacob Anawalt
> Gecko Software, Inc.
> janawalt <at> geckosoftware.com
> 435-752-8026
>

Le informazioni contenute in questo messaggio di posta elettronica sono riservate, rivolte
esclusivamente al destinatario e non comportano alcun vincolo ne' creano obblighi per la societa'
mittente, salvo che cio' non sia espressamente previsto da un precedente accordo.
Ogni altra persona diversa dal destinatario non puo' copiare o consegnare il presente messaggio o parte
dello stesso a terzi ne' trattare in alcun modo i dati contenuti. La informiamo inoltre che l'utilizzo non
autorizzato del messaggio o dei suoi allegati potrebbe costituire reato.

Grazie per la collaborazione.

The informations in this e-mail are are reserved, only addressed to the addressee and they are neither
binding on this Society nor to be understood as creating any obligation on its part except where provided
for an agreement.
Everyone different from the addressee (who received this e-mail) can't neither copy nor deliver the
message or a part of it in possesion of a third party, nor even deal with the informations in this e-mail.
Furthermore the unauthorized use of this message or any attachments could be an offence.

Thank you for your cooperation.


Gmane