ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dominique Devienne <>
Subject RE: Problem using cpptasks library outside of ant's lib directory
Date Tue, 01 Jun 2004 18:28:00 GMT
> From: Ben Pracht []
> I'm trying to use cpptasks using the jar file outside
> the ant\lib directory.  Unfortunately, it keeps saying this:
> C:\SoftCopyReader\current\build.xml:850: Referenced object
> base-msvc-compiler not correct type, is
> net.sf.antcontrib.cpptasks.CompilerDef should be
> net.sf.antcontrib.cpptasks.CompilerDef
> So my question:
> What does Ant or cpptasks want from me?

Each <taskdef>/<typedef> with an explicit classpath will use a new
ClassLoader unless explicitly specified to use the same ClassLoader (using
the loaderref attribute). So define a single classpath for CppTasks, and use
it for defining CppTasks' types/tasks. Something like:

<path id="cc.cp">
  <pathelement location="${CPPTASKS_HOME}/build/lib/cpptasks.jar"/>

<taskdef resource="cpptasks.tasks" loaderref="cc.loader">
  <classpath refid="cc.cp"/>
<typedef resource="cpptasks.types" loaderref="cc.loader">
  <classpath refid="cc.cp"/>


PS: Or save you the trouble, and put cpptasks.jar in ant/lib,
    or with Ant 1.6+, do -lib ${CPPTASKS_HOME}/build/lib on the
    command line

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message