Hello,
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" ;
-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
and the size is different.
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
to generate.
my build.xml
<project name="hello" default="compile"
xmlns:cpptasks="antlib:net.sf.antcontrib.cpptasks">
<target name="javah">
<exec dir="." executable="javah" >
<arg line="-classpath .
com.motorola.blur.service.common.photos.imaging.ImgDownSample"/>
</exec>
</target>
<target name="compile" depends="javah">
<mkdir dir="target/main/obj"/>
<cpptasks:cc outtype="shared" subsystem="console"
outfile="imgdownsample" objdir="target/main/obj">
<fileset dir="." includes="*.cpp"/>
<cpptasks:compiler name="g++"/>
<cpptasks:compilerarg
value="-I/data/s3op5/java/jdk1.6.0_12/include"/>
<cpptasks:compilerarg
value="-I/data/s3op5/java/jdk1.6.0_12/include/linux"/>
<cpptasks:compilerarg value="-fPIC"/>
<cpptasks:compilerarg
value="-I/usr/local/include/ImageMagick"/>
<cpptasks:compilerarg value="-g"/>
<cpptasks:compilerarg value="-O2"/>
<cpptasks:compilerarg value="-Wall"/>
<cpptasks:compilerarg value="-W"/>
<cpptasks:compilerarg value="-pthread"/>
<cpptasks:compilerarg value="-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="-L/usr/local/lib -lMagick++
-lMagickWand -lMagickCore -ltiff -lfreetype -ljpeg -lfontconfig
-lX11 -lbz2 -lz -lm -lpthread "/>
</cpptasks:cc>
</target>
</project>
If you get any idea, please let me know.
Thanks
Robert Wang
|