title: Compiling a C program using ant-contrib using cpptasks
body: <p>This is what my <code>build.xml</code> file looks like:</p>
  
  <pre><code>&lt;project name="test" xmlns:cpptasks="antlib:net.sf.antcontrib.cpptasks"&gt;
      &lt;target name="build-native"&gt;
          &lt;mkdir dir="/home/varun/Desktop/lucene/3018-test/check"/&gt;
          &lt;cpptasks:cc outtype="executable" subsystem="console" outfile="BuildNativeDir" objdir="/home/varun/Desktop/lucene/3018-test"&gt;
             &lt;fileset file="/home/varun/Desktop/lucene/3018-test/hello.c" /&gt;
          &lt;/cpptasks:cc&gt;
      &lt;/target&gt;
  &lt;/project&gt;
  </code></pre>
  
  <p>When I run the command <code>ant build-native</code> I get an error:</p>
  
  <pre><code>BUILD FAILED
  /home/varun/Desktop/lucene/3018-test/build.xml:4: Problem: failed to create task or type antlib:net.sf.antcontrib.cpptasks:cc
  Cause: The name is undefined.
  Action: Check the spelling.
  Action: Check that any custom tasks/types have been declared.
  Action: Check that any &lt;presetdef&gt;/&lt;macrodef&gt; declarations have taken place.
  No types or tasks have been defined in this namespace yet
  
  This appears to be an antlib declaration. 
  Action: Check that the implementing library exists in one of:
          -/usr/share/ant/lib
          -/home/varun/.ant/lib
          -a directory added on the command line with the -lib argument
  
  
  Total time: 0 seconds
  </code></pre>
  
  <p>But my <code>CLASSPATH</code> is set to <code>/usr/share/ant/lib</code> and I have placed the <code>ant-contrib-1.0b3.jar</code> in <code>/usr/share/ant/lib/ant-contrib-1.0b3.jar</code>.</p>
  
  <p>What am I doing wrong?</p>