You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4cxx-user@logging.apache.org by Andreas Grob <an...@bergauer.ch> on 2008/03/20 09:50:48 UTC
Building log4cxx with VC8 using runtime library /MT
Hi,
Failed finding an option for ant to do it directly I did it hand made using the
build-projects-vc8 option.
For the libs apr, aprutil and log4cxx I open the properties dialog and changed
the runtime library option to /MT (or /MTd for the debug lib).
Building apr and aprutil works well. But log4cxx didn't link because there are
missing dependencies. Well, not a big deal I had to add apr.lib and aprutil.lib
to the additional dependencies option.
should this not already be done by ant -Dbuild-projects-vc8?
I'm looking forward for log4cxx release 0.10.0! :-)
Cheers
~ Andreas
Re: Building log4cxx with VC8 using runtime library /MT
Posted by Curt Arnold <ca...@apache.org>.
On Mar 20, 2008, at 3:50 AM, Andreas Grob wrote:
> Hi,
>
> Failed finding an option for ant to do it directly I did it hand
> made using the
> build-projects-vc8 option.
>
> For the libs apr, aprutil and log4cxx I open the properties dialog
> and changed
> the runtime library option to /MT (or /MTd for the debug lib).
I've added an option to select the static C RTL as bug https://issues.apache.org/jira/browse/LOGCXX-254
. To build a static log4cxx library which uses the static
multithreaded C RTL use:
ant -Dlib.type=static -Druntime=static -Dfind=false
A dynamic log4cxx library which uses the static C RTL is unsafe since
the API passes STL strings over the DLL boundary which can easily
result in strings being allocated by one C RTL and freed by another.
The unit tests will fail quickly with heap corruption assertions or
access violations.
>
> Building apr and aprutil works well. But log4cxx didn't link because
> there are
> missing dependencies. Well, not a big deal I had to add apr.lib and
> aprutil.lib
> to the additional dependencies option.
>
>
> should this not already be done by ant -Dbuild-projects-vc8?
>
Unfortunately, the Microsoft Visual Studio.NET and later solution file
(.sln) format is not obvious and cpptasks does not generate it like
the VC6 .dsw file. I believe that I had some luck with a combination
of a .dsw and .vcproj's, but since I wasn't planning on providing VC7
or later project files with the log4cxx 0.10.0 release, I didn't
explore further. It looks like there is an analysis of the format at http://www.ondotnet.com/pub/a/dotnet/excerpt/vshacks_chap1/index.html?page=4
.
>
> I'm looking forward for log4cxx release 0.10.0! :-)
>
RC3 hopefully on Monday.