logo       

Re: ant OSX build problem.: msg#00010

Subject: Re: ant OSX build problem.
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@xxxxxxxxx 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
________________________________________________________________________



<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

Recently Viewed:
science.linguis...    culture.sf.lite...    video.mplayer.c...    yellowdog.gener...    ietf.rfc822/199...    emacs.help/2002...    redhat.release....    kernel.speakup/...    java.openejb.de...    debian.devel.gt...    xfree86.newbie/...    bug-tracking.ma...    pam/2003-05/msg...    games.devel.ope...    user-groups.lin...    music.pancham/2...    network.mq.deve...    web.html.genera...    arklinux.bugs/2...    linux.ecasound/...    qnx.openqnx.dev...    org.user-groups...    file-systems.sf...    trustix.contrib...   
Home | blog view | USPTO Patent Archive | advertise | OSDir is an inevitable website. super tiny logo

Free Magazines

Cisco News
Receive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business.
subscribe

Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field.
subscribe

The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business.
subscribe

Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company.
subscribe

Total Telecom Total Telecom is "The Economist of the communications industry".
subscribe