logging-log4cxx-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Derek Baum <derek.b...@paremus.com>
Subject Re: ant OSX build problem.
Date Fri, 13 Oct 2006 00:40:53 GMT
There are two problems here:

   1. unwanted references to UnicodeHelper::encodeWide() etc
   2. reference to _Unwind_Resume

The first should be fixed with a clean build using -Dhas.wchar_t=0 that 
re-runs configure.

The second is because we need to use the g++ linker.

I have re-investigated my previous post, and offer the following simpler 
solution:

I have modified build.xml to add <linker name="g++" /> where it matters, 
and I can then build from clean on my MacBook Pro, with only one manual 
interaction:
> build-shortsocketserver:
>        [cc] Starting dependency analysis for 1 files.
>        [cc] 1 files are up to date.
>        [cc] 0 files to be recompiled from dependency analysis.
>        [cc] 0 total files to be compiled.
>        [cc] Starting link
>        [cc] /usr/bin/ld: can't locate file for: -llog4cxx
>        [cc] collect2: ld returned 1 exit status

This is because the log4cxx shared library was incorrectly built with a 
.so extension, rather than .dylib.
Simply rename it and re-invoke ant; alternatively apply this cpptasks patch
<https://sourceforge.net/tracker/?func=detail&atid=416920&aid=1576280&group_id=36177>

Here's the context diff for my build.xml:

--- build.xml   (revision 463159)
+++ build.xml   (working copy)
@@ -187,6 +187,7 @@
     <property name="project.type" value="msvc6"/>
     <property name="project.dir" value="msvc"/>
     <property name="compiler" value="msvc"/>
+    <linker id="project.linker" name="${compiler}" />
 
     <!-- Default value for logchar on windows -->
     <property name="logchar" value="wchar_t"/>
@@ -227,6 +228,7 @@
 <target name="unix-init" depends="mac-init" if="is-unix">
 
     <property name="compiler" value="gcc"/>
+    <linker id="project.linker" name="g++" />
 
     <property name="lib.prefix" value="lib"/>
     <property name="lib.extension" value=".a"/>
@@ -721,6 +723,7 @@
                 objdir="${log4cxx.lib.dir}/log4cxx_obj"
                 debug="${debug}"
                 projectsOnly="${projectsOnly}">
+       <linker refid="project.linker" />
         <fileset dir="${src.dir}" includes="*.cpp" 
excludes="**/iconv_module.cpp"/>
         <fileset dir="${include.dir}" includes="**/*.h"/>
         <includepath path="${include.dir}"/>
@@ -751,6 +754,7 @@
                 objdir="${log4cxx.lib.dir}/${example.name}_obj"
                 debug="${debug}"
                 projectsOnly="${projectsOnly}">
+       <linker refid="project.linker" />
         <fileset dir="${example.src.dir}" includes="${example.includes}"/>
         <includepath path="${include.dir}"/>
         <includepath path="${apr.include.dir}"/>
@@ -854,6 +858,7 @@
                 objdir="${log4cxx.lib.dir}/shortsocketserver_obj"
                 debug="${debug}"
                 projectsOnly="${projectsOnly}">
+       <linker refid="project.linker" />
         <fileset dir="${tests.dir}/src">
            <include name="shortsocketserver.cpp"/>
            <include name="net/socketservertestcase.h"/>
@@ -883,6 +888,7 @@
                 objdir="${log4cxx.lib.dir}/log4cxx-test_obj"
                 debug="${debug}"
                 projectsOnly="${projectsOnly}">
+       <linker refid="project.linker" />
         <fileset dir="${tests.dir}/src" includes="**/*.cpp **/*.h">
              <exclude name="shortsocketserver.cpp"/>
         </fileset>
@@ -921,6 +927,7 @@
                 objdir="${log4cxx.lib.dir}/log4cxx-test_obj"
                 debug="${debug}"
                 projectsOnly="${projectsOnly}">
+       <linker refid="project.linker" />
         <fileset dir="${tests.dir}/src" includes="defaultinit/*.cpp 
main.cpp">
              <exclude name="shortsocketserver.cpp"/>
         </fileset>

Derek

>
>
>
> shai@rexee.com wrote:
>> Hi
>> I'm trying to build log4cxx on Mac version 10.4.7 but get the following
>> error:
>>
>> ant -Dhas.wchar_t=0
>>
>> .....
>> .....
>> .....
>>
>>
>> build:
>>        [cc] Starting dependency analysis for 144 files.
>>        [cc] 0 files are up to date.
>>        [cc] 144 files to be recompiled from dependency analysis.
>>        [cc] 144 total files to be compiled.
>>        [cc] Starting link
>>        [cc] ld: warning -prebind ignored because 
>> MACOSX_DEPLOYMENT_TARGET
>> environment variable greater or equal to 10.4
>>        [cc] ld: Undefined symbols:
>>        [cc] __Unwind_Resume
>>        [cc] __ZN7log4cxx7helpers13UnicodeHelper10decodeWideERPKwS3_
>>        [cc] __ZN7log4cxx7helpers13UnicodeHelper10encodeWideEjPw
>>        [cc] __ZN7log4cxx7helpers13UnicodeHelper10lengthUTF8Ew
>>        [cc] /usr/bin/libtool: internal link edit command failed
>>
>> BUILD FAILED
>> /Users/shaideljo/repos/src/users/shai-sand/logging-log4cxx/build.xml:723: 
>>
>> gcc failed with return code 1
>>   

________________________________________________________________________
The information transmitted is intended only for the person(s) or entity
to which it is addressed and may contain confidential and/or privileged
material. Any review, retransmission, dissemination or other use of, or
taking of any action in reliance upon, this information by persons or
entities other than the intended recipient is prohibited. If you
received this in error, please contact the sender and delete the
material from any computer. 

Paremus Limited.
107-111 Fleet Street, London EC4A 2AB.  Phone number +44 20 7936 9098
________________________________________________________________________

Mime
View raw message