cpptasks: Problem with MinGW on Windows Vista
Jon Kristensen <[email protected]> Tue, 26 Aug 2008 09:34:25 +0200
| Newsgroups | gmane.comp.java.ant-contrib.devel |
|---|---|
| Message-ID | <[email protected]> |
Dear cpptasks developers: I'm trying to compile ogre4j* with the MinGW toolset (on Vista). ogre4j is meant to be compiled with Visual C++ but I didn't want to depend on those libraries. I enabled g++ by modifying a line to say "<condition property="cpp.compiler" value="g++">" and typed "ant" in the build directory. I got the following output: "C:\ogre4j\ogre4j-1.4.9-beta5-src>ant Buildfile: build.xml ogre4j.mkdir: ogre4j.build.c: [cc] 749 total files to be compiled. BUILD FAILED C:\ogre4j\ogre4j-1.4.9-beta5-src\build.xml:104: Could not launch gcc: java.io.IOException: Cannot run program "gcc" (in directory "C:\ogre4j\ogre4j-1.4.9-beta5-src\bin\c\release\obj"): CreateProcess error=206, The filename or extension is too long Total time: 0 seconds" What seems to be the problem here? Is there something wrong with the ogre4j build file (attached to this e-mail) or is there a problem with using MinGW? I have g++ in my path and can compile other programs with it. Thank you so much in advance! /Jon *) The ogre4j project can be found at http://ogre4j.sourceforge.net/. ------------------------------------------------------------------------- This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100&url=/ _______________________________________________ Ant-contrib-developers mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/ant-contrib-developers
build.xml
(text/xml, 7.6 KB)
<?xml version="1.0" encoding="UTF-8"?>
<project basedir="." default="ogre4j.build" name="ogre4j"
xmlns:cpptasks="antlib:org.sf.net.antcontrib.cpptasks">
<description>ANT build file to automate the build of the
distribution files for ogre4j. This script will be
used by other projects to build the jar and srs.zip
to copy them into their dependencies.
</description>
<property name="ogre4j.version"
description="The version of ogre4j."
value="1.4.9" />
<property name="ogre4j.export-package"
description="The packages that should be exported by the eclipse plugin."
value="org.xbig.base, org.ogre4j, org.ogre4j.nativelisteners, org.ogre4j.emittercommands, org.ogre4j.overlayelementcommands, org.std, org.stdext" />
<property name="javadoc.maxmemory"
description="Maximum amount of memory to be used during javadoc generation."
value="1G" />
<property name="cpp.debug"
description="Compile C++ code with debug information."
value="false" />
<!-- ***********************************************************
DO NOT EDIT BEYOND THIS COMMENT
***********************************************************-->
<condition property="cpp.platform" value="g++">
<os family="windows"/>
</condition>
<condition property="cpp.platform" value="linux">
<os name="linux"/>
</condition>
<condition property="cpp.platform" value="mac">
<os family="mac"/>
</condition>
<condition property="cpp.platform" value="unix">
<os family="unix"/>
</condition>
<condition property="cpp.compiler" value="g++">
<os family="windows"/>
</condition>
<!-- ***********************************************************-->
<property name="ogre4j.src" value="src" />
<property name="ogre4j.src.java" value="${ogre4j.src}/java" />
<property name="ogre4j.src.c" value="${ogre4j.src}/c" />
<!-- ***********************************************************-->
<property name="ogre4j.bin" value="bin" />
<property name="ogre4j.bin.java" value="${ogre4j.bin}/java" />
<property name="ogre4j.bin.c" value="${ogre4j.bin}/c" />
<property name="ogre4j.bin.c.release.lib" value="${ogre4j.bin.c}/release/lib/ogre4j"/>
<!-- ***********************************************************-->
<property name="ogre4j.dist" value="dist" />
<property name="ogre4j.jar" value="org.ogre4j_${ogre4j.version}.jar" />
<property name="ogre4j.dist.jar" value="${ogre4j.dist}/${ogre4j.jar}" />
<property name="ogre4j.srczip"
value="org.ogre4j_${ogre4j.version}-src.zip" />
<property name="ogre4j.dist.src" value="${ogre4j.dist}/${ogre4j.srczip}" />
<property name="ogre4j.dist.full"
value="${ogre4j.dist}/org.ogre4j_${ogre4j.version}.zip" />
<!-- ***********************************************************-->
<property name="ogre4j.doc" value="doc" />
<!-- ***********************************************************-->
<target name="ogre4j.build" depends="ogre4j.build.c,ogre4j.build.java">
</target>
<!-- ***********************************************************-->
<property environment="env"/>
<property name="ant.jar" value="ant_lib"/>
<property name="cpp.tasks" value="cpptasks-1.0.0.b4.jar"/>
<property name="ant-contrib.tasks" value="ant-contrib-1.0b3.jar"/>
<typedef classpath="${ant.jar}/${cpp.tasks}"
resource="cpptasks.types" />
<taskdef classpath="${ant.jar}/${cpp.tasks}"
resource="cpptasks.tasks" />
<taskdef classpath="${ant.jar}/${ant-contrib.tasks}"
resource="net/sf/antcontrib/antlib.xml"/>
<target name="ogre4j.build.c" depends="ogre4j.mkdir">
<if>
<equals arg1="${cpp.debug}" arg2="true" />
<then>
<cc subsystem="console" objdir="${ogre4j.bin.c}/debug/obj" debug="true"
outtype="shared" name="${cpp.compiler}" exceptions="true"
rtti="true" optimize="speed" outfile="${ogre4j.bin.c}/debug/lib/ogre4j"
failonerror="true">
<includepath path="${ogre4j.src.c}/include" />
<includepath path="${env.OGRE_HOME}/include" />
<includepath path="${env.JAVA_HOME}/include" />
<includepath path="${env.JAVA_HOME}/include/${cpp.platform}" />
<libset libs="OgreMain_d" dir="${env.OGRE_HOME}/lib" />
<libset libs="OIS_d" dir="${env.OGRE_HOME}/lib" />
<precompile prototype="${ogre4j.src.c}/src/Ogre4JPrecompiledHeaders.cpp">
<except dir="${ogre4j.src.c}/src" includes="jni_*"/>
</precompile>
<fileset dir="${ogre4j.src.c}/src" includes="class_org_ogre4j_A*.cpp"/>
</cc>
</then>
<else>
<cc subsystem="console" objdir="${ogre4j.bin.c}/release/obj" debug="false"
outtype="shared" name="${cpp.compiler}" exceptions="true"
rtti="true" optimize="speed" outfile="${ogre4j.bin.c.release.lib}"
failonerror="true">
<includepath path="${ogre4j.src.c}/include" />
<includepath path="${env.OGRE_HOME}/include" />
<includepath path="${env.JAVA_HOME}/include" />
<includepath path="${env.JAVA_HOME}/include/${cpp.platform}" />
<libset libs="OgreMain" dir="${env.OGRE_HOME}/lib" />
<libset libs="OIS" dir="${env.OGRE_HOME}/lib" />
<precompile prototype="${ogre4j.src.c}/src/Ogre4JPrecompiledHeaders.cpp">
<except dir="${ogre4j.src.c}/src" includes="jni_*"/>
</precompile>
<fileset dir="${ogre4j.src.c}/src"/>
</cc>
</else>
</if>
</target>
<!-- ***********************************************************-->
<target name="ogre4j.build.java" depends="ogre4j.mkdir">
<javac srcdir="${ogre4j.src.java}" destdir="${ogre4j.bin.java}" />
</target>
<!-- ***********************************************************-->
<target name="ogre4j.build.jar" depends="ogre4j.build.java">
<jar basedir="${ogre4j.bin.java}" destfile="${ogre4j.dist.jar}" />
</target>
<!-- ***********************************************************-->
<target name="ogre4j.build.srczip">
<zip basedir="${ogre4j.src}" destfile="${ogre4j.dist.src}"
excludes="**/*.ncb,**/*.sln,**/*suo"/>
</target>
<!-- ***********************************************************-->
<target name="ogre4j.build.dist">
<zip basedir="${basedir}"
destfile="${ogre4j.dist.full}"
excludes="*.jar,*.zip" />
<if>
<equals arg1="${cpp.platform}" arg2="win32" />
<then>
<copyfile src="${ogre4j.bin.c}/release/lib/ogre4j.dll" dest="${ogre4j.dist}"/>
</then>
<else>
<copyfile src="${ogre4j.bin.c}/release/lib/libogre4j.so" dest="${ogre4j.dist}"/>
</else>
</if>
</target>
<!-- ***********************************************************-->
<target name="ogre4j.build.doc">
<javadoc packagenames="${ogre4j.export-package}"
sourcepath="${ogre4j.src.java}"
defaultexcludes="yes"
destdir="${ogre4j.doc}"
author="true"
version="true"
use="true"
windowtitle="ogre4j ${ogre4j.version}"
maxmemory="${javadoc.maxmemory}">
<doctitle>ogre4j ${ogre4j.version}</doctitle>
<bottom>Copyright © 2007 netAllied GmbH. All Rights Reserved.</bottom>
<tag name="todo" scope="all" description="To do:" />
</javadoc>
</target>
<!-- ***********************************************************-->
<target name="ogre4j.clean">
<delete dir="${ogre4j.bin}" />
<delete dir="${ogre4j.dist}" />
<delete dir="${ogre4j.doc}" />
</target>
<!-- ***********************************************************-->
<target name="ogre4j.mkdir">
<mkdir dir="${ogre4j.bin.java}" />
<mkdir dir="${ogre4j.bin.c}" />
<mkdir dir="${ogre4j.bin.c}/debug/obj" />
<mkdir dir="${ogre4j.bin.c}/release/obj" />
<mkdir dir="${ogre4j.bin.c}/debug/lib" />
<mkdir dir="${ogre4j.bin.c}/release/lib" />
<mkdir dir="${ogre4j.doc}" />
<mkdir dir="${ogre4j.dist}" />
</target>
</project>