> I'm very new to ant and cpp-tasks, great tool.
>
> I using Microsoft VC6. I trying to build a dll. It is required to link
> against 3rd party libs.
> I am trying to get the paths and libs names to the linker
>
> From what I can see It is failing to take the <libset> I require for the
> build.
> I have tried every permutation I can think of.
>
> I have include the target in question and the output from ant with the
debug
> switch on.
> I am curious as to why the quotes are still present for the linkerarg
> containing the lib paths.
> This is only means by which I have been able to get parameters to the
> command line.
> I have tried position=end but the version i have refuses it (should I
> upgrade)
If you are using the "alpha" release of CppTask, please build it from the
CVS. That version is extremely out of date, but I haven't been able to find
the time to get the documentation done for another build. I've been saying
it for several months now, but maybe I can get a release out this weekend.
>
> I have gotten this far but need your help to complete this
>
> Thank you.
>
> Martin
>
> <target name="cpp-lib" depends="prepare-idl">
> <mkdir dir="${build.dir}/obj"/>
> <cc debug="true" link="shared"
> outfile="${lib.dir}/xmlBlasterClient" objdir="${build.dir}/obj"
> multithreaded="true" exceptions="true">
> <!-- <compiler refid="gcc"/> -->
> <compiler refid="msvc"/>
> <!-- <compiler refid="bcc"/> -->
> <fileset dir="${src.cpp.dir}/generated" includes="*C.cpp"/>
> <fileset dir="${src.cpp.dir}/generated" includes="*S.cpp"/>
> <fileset dir="${src.cpp.dir}/util" includes="*.cpp" />
> <fileset dir="${src.cpp.dir}/client" includes="*.cpp" />
You should not need to add includepath's elements for the standard include
paths. CppTask will determine the built-in include paths in a compiler
specific manner (from the INCLUDE env variable for VC for example).
> <includepath location="${ms.path}/include" />
> <includepath location="${ms.path}/mfc/include" />
> <includepath location="${ms.path}/atl/include" />
> <includepath location="${src.cpp.dir}" />
> <includepath location="${src.cpp.dir}/generated" />
> <!-- sysincludepath location="${STL_HOME}/stlport" /-->
> <sysincludepath location="${corba.home}" />
> <sysincludepath location="${corba.home}/TAO" />
> <sysincludepath location="${corba.home}/ace" />
> <sysincludepath location="${corba.home}/TAO/tao" />
> <sysincludepath location="${corba.home}/TAO/orbsvcs" />
> <sysincludepath location="${XMLCPP_HOME}/src"/>
> <sysincludepath location="${XMLCPP_HOME}/include" />
> <sysincludepath location="${XMLCPP_HOME}/src/xercesc" />
> <linker name="msvc" if="use-msvc">
> <!-- <linkerarg value="-Xs"/> -->
You should not need to ".lib" extension on the names in the libset. It
shouldn't hurt, but it might. The idea was that libset would take something
like libs="xerces-c_1" and represent it like -l xerces-c_1 for GCC and find
the corresponding xerces-c_1.lib for VC.
If you were only concerned about linking on Windows, you could also just put
in a <fileset> that matched the ".lib" files. Files with extensions ".obj"
and ".lib" will get passed to the linker.
> <libset id="libs" libs="aced.lib, TAOd.lib,
TAO_PortableServerd.lib,
> TAO_CosNamingd.lib, xerces-c_1D.lib" />
> </linker>
The Ant class that executes the command will wrap any argument that contains
spaces within quotes. Probably to "transparently" handle filenames that
contain spaces passed as arguments. To work around this, you would need to
have each part as a distinct linkerarg.
> <linkerarg value="/LIBPATH:${corba.home}/TAO ${corba.home}/ace
> ${corba.home}/TAO/tao" />
> <defineset>
> <define name="TAO" value="1" />
> <define name="WIN32" value="1" />
> <define name="_DEBUG" value="1" />
> <define name="_WINDOWS" value="1" />
> <define name="_MBCS" value="1" />
> <define name="_USRDLL" value="1" />
> <define name="DLL_BUILD" value="1" />
> <!-- undefine name="UNWANTEDDEF" / -->
> </defineset>
> </cc>
> </target>
>
> [cc] link "/LIBPATH:D:/CORBA_STUFF/ACE_wrappers/TAO D:/CORBA_STUFF/ACE_wr
> appers/ace D:/CORBA_STUFF/ACE_wrappers/TAO/tao" /NOLOGO /INCREMENTAL:NO
/DLL
> /IN
> CREMENTAL:NO /MAP:NO /OUT:xmlBlasterClient.dll
> xmlBlasterClient\build\obj\xmlBla
> sterC.obj xmlBlasterClient\build\obj\Log.obj
> xmlBlasterClient\build\obj\CorbaCon
> nection.obj xmlBlasterClient\build\obj\CompatibleCorba.obj
> xmlBlasterClient\buil
> d\obj\xmlBlasterS.obj
> Execute:Java13CommandLauncher: link
> "/LIBPATH:D:/CORBA_STUFF/ACE_wrappers/TAO D:
> /CORBA_STUFF/ACE_wrappers/ace D:/CORBA_STUFF/ACE_wrappers/TAO/tao" /NOLOGO
> /INCR
> EMENTAL:NO /DLL /INCREMENTAL:NO /MAP:NO /OUT:xmlBlasterClient.dll
> xmlBlasterClie
> nt\build\obj\xmlBlasterC.obj xmlBlasterClient\build\obj\Log.obj
> xmlBlasterClient
> \build\obj\CorbaConnection.obj
> xmlBlasterClient\build\obj\CompatibleCorba.obj xm
> lBlasterClient\build\obj\xmlBlasterS.obj
|