About the <cpptask:cc> g++ can not work

"Wang Ting-KFN436" <[email protected]> Wed, 11 Mar 2009 18:05:28 +0800
Newsgroups gmane.comp.java.ant-contrib.devel
Message-ID <[email protected]>
This is a multi-part message in MIME format.

--===============9120282635517103872==
Content-class: urn:content-classes:message
Content-Type: multipart/alternative;
	boundary="----_=_NextPart_001_01C9A230.E7FED853"

This is a multi-part message in MIME format.

------_=_NextPart_001_01C9A230.E7FED853
Content-Type: text/plain;
	charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

Hello,
=20
=20
 I meet a problem, I wrote a build.xml which use the tag <cpptask:cc> to
generate the shared .so I needed. However, it really can generate but
will get the error:"undefined symbol:_ZNSs4_Rep11_S_terminalE" ;
=20
 -rwxr-xr-x  1 s3op5 netop  97462 Mar 11 08:53 libimgdownsample.so_bad
 -rwxr-xr-x  1 s3op5 netop  98220 Mar  9 08:36 libimgdownsample.so.good=20
=20
and the size is different.
=20
the work one I use: g++  -I/data/s3op5/java/jdk1.6.0_12/include
-I/data/s3op5/java/jdk1.6.0_12/include/linux -fPIC -shared
-Wl,-soname,libimgdownsample.so -o libimgdownsample.so ImgDownSample.cpp
-I/usr/local/include/ImageMagick -g -O2 -Wall -W -pthread
-L/usr/local/lib -L/usr/X11R6/lib -L/usr/lib64 -Wl,--rpath
-Wl,/usr/lib64 -lfreetype -lz -L/usr/local/lib
-L/usr/local/lib -lMagick++ -lMagickWand -lMagickCore -ltiff -lfreetype
-ljpeg -lfontconfig -lX11 -lbz2 -lz -lm -lpthread =20
to generate.
=20
=20
my build.xml
=20
<project name=3D"hello" default=3D"compile"
xmlns:cpptasks=3D"antlib:net.sf.antcontrib.cpptasks">
    <target name=3D"javah">
       <exec dir=3D"." executable=3D"javah" >      =20
         <arg line=3D"-classpath .
com.motorola.blur.service.common.photos.imaging.ImgDownSample"/>
      </exec>
    </target>
=20
    <target name=3D"compile" depends=3D"javah">
        <mkdir dir=3D"target/main/obj"/>
         <cpptasks:cc outtype=3D"shared" subsystem=3D"console"
outfile=3D"imgdownsample" objdir=3D"target/main/obj">
           <fileset dir=3D"." includes=3D"*.cpp"/>
           <cpptasks:compiler name=3D"g++"/>
           <cpptasks:compilerarg
value=3D"-I/data/s3op5/java/jdk1.6.0_12/include"/>
           <cpptasks:compilerarg
value=3D"-I/data/s3op5/java/jdk1.6.0_12/include/linux"/>
           <cpptasks:compilerarg value=3D"-fPIC"/>
           <cpptasks:compilerarg
value=3D"-I/usr/local/include/ImageMagick"/>
           <cpptasks:compilerarg value=3D"-g"/>
           <cpptasks:compilerarg value=3D"-O2"/>
           <cpptasks:compilerarg value=3D"-Wall"/>
           <cpptasks:compilerarg value=3D"-W"/>
           <cpptasks:compilerarg value=3D"-pthread"/>
           <cpptasks:compilerarg value=3D"-L/usr/local/lib
-L/usr/X11R6/lib -L/usr/lib64 -Wl,--rpath -Wl,/usr/lib64 -lfreetype -lz
-L/
usr/local/lib"/>
           <cpptasks:compilerarg value=3D"-L/usr/local/lib -lMagick++
-lMagickWand -lMagickCore -ltiff -lfreetype -ljpeg -lfontconfig=20
-lX11 -lbz2 -lz -lm -lpthread "/>
         </cpptasks:cc>
   </target>
</project>
=20
=20
If you get any idea, please let me know.=20
=20
Thanks=20
=20
=20
Robert Wang=20
=20

------_=_NextPart_001_01C9A230.E7FED853
Content-Type: text/html;
	charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Dus-ascii">
<META content=3D"MSHTML 6.00.2900.3492" name=3DGENERATOR></HEAD>
<BODY>
<DIV><SPAN class=3D305395809-11032009><FONT =
size=3D2>Hello,</FONT></SPAN></DIV>
<DIV><SPAN class=3D305395809-11032009><FONT =
size=3D2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=3D305395809-11032009><FONT =
size=3D2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=3D305395809-11032009><FONT size=3D2>&nbsp;I meet a =
problem, I wrote=20
a build.xml which use the tag &lt;cpptask:cc&gt; to generate the shared =
.so I=20
needed. However, it really can generate but will get the =
error:"undefined=20
symbol:_ZNSs4_Rep11_S_terminalE" ;</FONT></SPAN></DIV>
<DIV><SPAN class=3D305395809-11032009><FONT =
size=3D2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=3D305395809-11032009><FONT =
size=3D2>&nbsp;-rwxr-xr-x&nbsp; 1 s3op5=20
netop&nbsp; 97462 Mar 11 08:53 =
libimgdownsample.so_bad<BR>&nbsp;-rwxr-xr-x&nbsp;=20
1 s3op5 netop&nbsp; 98220 Mar&nbsp; 9 08:36 libimgdownsample.so.good=20
</FONT></SPAN></DIV>
<DIV><SPAN class=3D305395809-11032009><FONT =
size=3D2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=3D305395809-11032009><FONT size=3D2>and the size is=20
different.</FONT></SPAN></DIV>
<DIV><SPAN class=3D305395809-11032009><FONT =
size=3D2>&nbsp;</FONT></SPAN></DIV>
<DIV><SPAN class=3D305395809-11032009><FONT size=3D2>the work one I use: =
g++&nbsp;=20
-I/data/s3op5/java/jdk1.6.0_12/include=20
-I/data/s3op5/java/jdk1.6.0_12/include/linux -fPIC -shared=20
-Wl,-soname,libimgdownsample.so -o libimgdownsample.so=20
ImgDownSample.cpp&nbsp;-I/usr/local/include/ImageMagick -g -O2 -Wall -W=20
-pthread<BR>-L/usr/local/lib -L/usr/X11R6/lib -L/usr/lib64 -Wl,--rpath=20
-Wl,/usr/lib64 -lfreetype -lz -L/usr/local/lib<BR>-L/usr/local/lib =
-lMagick++=20
-lMagickWand -lMagickCore -ltiff -lfreetype -ljpeg -lfontconfig -lX11 =
-lbz2 -lz=20
-lm -lpthread &nbsp;</FONT></SPAN></DIV>
<DIV><SPAN class=3D305395809-11032009><FONT size=3D2>to=20
generate.</FONT></SPAN></DIV>
<DIV><SPAN class=3D305395809-11032009><FONT =
size=3D2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=3D305395809-11032009><FONT =
size=3D2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=3D305395809-11032009><FONT size=3D2>my=20
build.xml</FONT></SPAN></DIV>
<DIV><SPAN class=3D305395809-11032009><FONT =
size=3D2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=3D305395809-11032009><FONT size=3D2>&lt;project =
name=3D"hello"=20
default=3D"compile"=20
xmlns:cpptasks=3D"antlib:net.sf.antcontrib.cpptasks"&gt;<BR>&nbsp;&nbsp;&=
nbsp;=20
&lt;target name=3D"javah"&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
&lt;exec=20
dir=3D"." executable=3D"javah" &gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;arg =
line=3D"-classpath .=20
com.motorola.blur.service.common.photos.imaging.ImgDownSample"/&gt;<BR>&n=
bsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
&lt;/exec&gt;<BR>&nbsp;&nbsp;&nbsp;=20
&lt;/target&gt;<BR>&nbsp;<BR>&nbsp;&nbsp;&nbsp; &lt;target =
name=3D"compile"=20
depends=3D"javah"&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
&lt;mkdir=20
dir=3D"target/main/obj"/&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp=
;&nbsp;=20
&lt;cpptasks:cc outtype=3D"shared" subsystem=3D"console" =
outfile=3D"imgdownsample"=20
objdir=3D"target/main/obj"&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb=
sp;&nbsp;&nbsp;&nbsp;=20
&lt;fileset dir=3D"."=20
includes=3D"*.cpp"/&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;&nbsp;=20
&lt;cpptasks:compiler=20
name=3D"g++"/&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;=20
&lt;cpptasks:compilerarg=20
value=3D"-I/data/s3op5/java/jdk1.6.0_12/include"/&gt;<BR>&nbsp;&nbsp;&nbs=
p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
&lt;cpptasks:compilerarg=20
value=3D"-I/data/s3op5/java/jdk1.6.0_12/include/linux"/&gt;<BR>&nbsp;&nbs=
p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
&lt;cpptasks:compilerarg=20
value=3D"-fPIC"/&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&=
nbsp;&nbsp;=20
&lt;cpptasks:compilerarg=20
value=3D"-I/usr/local/include/ImageMagick"/&gt;<BR>&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
&lt;cpptasks:compilerarg=20
value=3D"-g"/&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;=20
&lt;cpptasks:compilerarg=20
value=3D"-O2"/&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb=
sp;&nbsp;=20
&lt;cpptasks:compilerarg=20
value=3D"-Wall"/&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&=
nbsp;&nbsp;=20
&lt;cpptasks:compilerarg=20
value=3D"-W"/&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;=20
&lt;cpptasks:compilerarg=20
value=3D"-pthread"/&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;&nbsp;=20
&lt;cpptasks:compilerarg value=3D"-L/usr/local/lib -L/usr/X11R6/lib =
-L/usr/lib64=20
-Wl,--rpath -Wl,/usr/lib64 -lfreetype -lz=20
-L/<BR>usr/local/lib"/&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&=
nbsp;&nbsp;&nbsp;=20
&lt;cpptasks:compilerarg value=3D"-L/usr/local/lib -lMagick++ =
-lMagickWand=20
-lMagickCore -ltiff -lfreetype -ljpeg -lfontconfig <BR>-lX11 -lbz2 -lz =
-lm=20
-lpthread "/&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
&lt;/cpptasks:cc&gt;<BR>&nbsp;&nbsp;=20
&lt;/target&gt;<BR>&lt;/project&gt;</FONT></SPAN></DIV>
<DIV><SPAN class=3D305395809-11032009><FONT =
size=3D2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=3D305395809-11032009><FONT =
size=3D2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=3D305395809-11032009><FONT size=3D2>If you get any =
idea, please let=20
me know. </FONT></SPAN></DIV>
<DIV><SPAN class=3D305395809-11032009><FONT =
size=3D2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=3D305395809-11032009><FONT size=3D2>Thanks =
</FONT></SPAN></DIV>
<DIV><SPAN class=3D305395809-11032009><FONT =
size=3D2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=3D305395809-11032009><FONT =
size=3D2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=3D305395809-11032009><FONT size=3D2>Robert Wang=20
</FONT></SPAN></DIV>
<DIV><SPAN class=3D305395809-11032009><FONT face=3D&#23435;&#20307;=20
size=3D2></FONT></SPAN>&nbsp;</DIV></BODY></HTML>

------_=_NextPart_001_01C9A230.E7FED853--


--===============9120282635517103872==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

------------------------------------------------------------------------------
Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are
powering Web 2.0 with engaging, cross-platform capabilities. Quickly and
easily build your RIAs with Flex Builder, the Eclipse(TM)based development
software that enables intelligent coding and step-through debugging.
Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com
--===============9120282635517103872==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
Ant-contrib-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ant-contrib-developers

--===============9120282635517103872==--