ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dominique Devienne <>
Subject RE: Ant novice and cpptasks
Date Thu, 16 Oct 2003 15:23:06 GMT
> From: Deidre McClain []
> I've just begun to use Ant and my project is to execute a build in Ant of
> c++ source code.  I've installed the cpptasks and have the following in my
> build file:

Welcome to Ant/CppTasks.

First, the Ant list is not the right list to ask ;-)
CppTasks' list is the Ant-Contrib one. Check out the project page on
I'm CC'ing the proper list.

> <taskdef resource="cpptasks.tasks"/>
> <typedef resource="cpptasks.types"/>

The two lines above are fine.

> <taskdef name="cc" classname="net.sf.antcontrib.cpptasks.CCTask"/>
> <typedef name="linker" classname="net.sf.antcontrib.cpptasks.LinkerDef"/>
> <typedef name="compiler"
> classname="net.sf.antcontrib.cpptasks.CompilerDef"/>

These are not, since duplicate what the two first have done...

> <cc name="gcc" debug="true" exceptions="true" incremental="true"
> link="static" objdir="${basedir.bld.database.dir}" outfile="fcmsgs.o">

outfile's name is wrong. It shouldn't end in .o. It's supposed to be the
name of the library or executable to generate, and in addition, it should 
be the name without platform-specific extension. CppTasks will add the
proper extension (like .so or .dll, depending on the OS).

> 	<compiler name="gcc">
No need for a compiler or linker, you already specified it in <cc>.

> 		<fileset dir="${basedir.bld.database.dir}">
> 			<include name="fcmsgs.c"/>
> 			<include name="fcmsgs.h"/>

I never put .h files to compile, you set an <includepath> to locate them.

> 		</fileset>
> 	</compiler>
> 	<linker name="gcc"></linker>

Again no need for a linker element here.

> </cc>
> I get the error message below:
> file: D:/OFP/OfpBase/build.xml:233: Could not launch gcc:
> CreateProcess: gcc -c -g -W

And finally, this means GCC in not in your Path. Do you really intend to
compile with GCC on Windows?

I'm afraid you have quite a bit ahead of you ;-) Good luck, --DD

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

View raw message