[ant-contrib - Help] Problem: failed to create task or type cc
"SourceForge.net" <[email protected]> Thu, 25 Oct 2007 08:11:49 -0700
| Newsgroups | gmane.comp.java.ant-contrib.devel |
|---|---|
| Message-ID | <[email protected]> |
Read and respond to this message at:
https://sourceforge.net/forum/message.php?msg_id=4587974
By: sharadb
Hi,
I am to Ant. We would like to use Ant for building C++ apps.
I first tried a simple example with java and it worked fine, but when I try
to execute a 'hello world' program in C++ I get an error.
Here is what I am using on Microsoft Windows.
apache-ant-1.7.0
ant-contrib-1.0b3
cpptasks-1.0b4
I have set the following env variables:
- set ANT_HOME: C:\Ant
- set JAVA_HOME: C:\j2sdk1.4.2_16\bin
- set PATH: included JAVA_HOME and ANT_HOME
I have the ant-contrib-1.0b3.jar and cpptasks.jar in C:\Ant\lib folder.
This is my build.xml
<?xml version="1.0"?>
<project xmlns:cpptasks="antlib:org.sf.net.antcontrib.cpptasks" name="Hello"
default="hello" basedir=".">
<target name="init">
<condition property="cc" value="msvc">
<os family="windows"/>
</condition>
<condition property="cc" value="gcc">
<os family="unix"/>
</condition>
</target>
<target name="hello" depends="init">
<cc name="${cc}" outfile="hello">
<fileset dir="." includes="hello.cpp"/>
</cc>
</target>
</project>
hello.cpp is in C:\Ant\src folder.
The error I get is:::
C:\Ant>ant -verbose
Apache Ant version 1.7.0 compiled on December 13 2006
Buildfile: build.xml
Detected Java version: 1.4 in: C:\j2sdk1.4.2_16\jre
Detected OS: Windows XP
parsing buildfile C:\Ant\build.xml with URI = file:/C:/Ant/build.xml
Project base dir set to: C:\Ant
Build sequence for target(s) `hello' is [init, hello]
Complete build sequence is [init, hello, ]
init:
[antlib:org.apache.tools.ant] Could not load definitions from resource
org/apach
e/tools/ant/antlib.xml. It could not be found.
hello:
BUILD FAILED
C:\Ant\build.xml:12: Problem: failed to create task or type cc
Cause: The name is undefined.
Action: Check the spelling.
Action: Check that any custom tasks/types have been declared.
Action: Check that any <presetdef>/<macrodef> declarations have taken place.
at org.apache.tools.ant.UnknownElement.getNotFoundException(UnknownEleme
nt.java:481)
at org.apache.tools.ant.UnknownElement.makeObject(UnknownElement.java:41
3)
at org.apache.tools.ant.UnknownElement.maybeConfigure(UnknownElement.jav
a:160)
at org.apache.tools.ant.Task.perform(Task.java:347)
at org.apache.tools.ant.Target.execute(Target.java:357)
at org.apache.tools.ant.Target.performTasks(Target.java:385)
at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1329)
at org.apache.tools.ant.Project.executeTarget(Project.java:1298)
at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExe
cutor.java:41)
at org.apache.tools.ant.Project.executeTargets(Project.java:1181)
at org.apache.tools.ant.Main.runBuild(Main.java:698)
at org.apache.tools.ant.Main.startAnt(Main.java:199)
at org.apache.tools.ant.launch.Launcher.run(Launcher.java:257)
at org.apache.tools.ant.launch.Launcher.main(Launcher.java:104)
Total time: 0 seconds
Can anyone tell me where am I going wrong?
Thanks,
Sharad.
______________________________________________________________________
You are receiving this email because you elected to monitor this forum.
To stop monitoring this forum, login to SourceForge.net and visit:
https://sourceforge.net/forum/unmonitor.php?forum_id=113701
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/