Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/ant/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
使用cpptasks使用ant contrib编译C程序_Ant_Ant Contrib - Fatal编程技术网

使用cpptasks使用ant contrib编译C程序

使用cpptasks使用ant contrib编译C程序,ant,ant-contrib,Ant,Ant Contrib,这就是我的build.xml文件的外观: <project name="test" xmlns:cpptasks="antlib:net.sf.antcontrib.cpptasks"> <target name="build-native"> <mkdir dir="/home/varun/Desktop/lucene/3018-test/check"/> <cpptasks:cc outtype="execut

这就是我的
build.xml
文件的外观:

<project name="test" xmlns:cpptasks="antlib:net.sf.antcontrib.cpptasks">
    <target name="build-native">
        <mkdir dir="/home/varun/Desktop/lucene/3018-test/check"/>
        <cpptasks:cc outtype="executable" subsystem="console" outfile="BuildNativeDir" objdir="/home/varun/Desktop/lucene/3018-test">
           <fileset file="/home/varun/Desktop/lucene/3018-test/hello.c" />
        </cpptasks:cc>
    </target>
</project>
但是我的
CLASSPATH
被设置为
/usr/share/ant/lib
,并且我已经将
ant-contrib-1.0b3.jar
放在
/usr/share/ant/lib/ant-contrib-1.0b3.jar


我做错了什么?

cpptask
未包含在
antcontrib-*.jar
中。你必须把它分开


我刚刚尝试了
cpptasks-1.0-beta5
,但它没有编译
cpptasks-1.0-beta4
在存档中有一个预编译的jar,它工作得很好。

谢谢。这有帮助。我还成功地构建了
cpptasks-1.0-beta5
。我使用这个命令
antbuildtests
,jar在
/target/lib/
目录中编译。
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 <presetdef>/<macrodef> 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