gpt4 book ai didi

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

转载 作者:行者123 更新时间:2023-12-02 11:19:51 26 4
gpt4 key购买 nike

这就是我的 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>

当我运行命令 ant build-native 时,出现错误:

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

但我的 CLASSPATH 设置为 /usr/share/ant/lib 并且我已放置 ant-contrib-1.0b3.jar > 在 /usr/share/ant/lib/ant-contrib-1.0b3.jar 中。

我做错了什么?

最佳答案

cpptask 未包含在 ant-contrib-*.jar 中。你必须download分别。

我刚刚尝试了cpptasks-1.0-beta5,但它没有编译。 cpptasks-1.0-beta4 存档中有一个预编译的 jar,并且运行良好。

关于ant - 使用 ant-contrib 使用 cpptasks 编译 C 程序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5638149/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com