From: SourceForge.net <no...@so...> - 2008-04-04 07:55:21
|
Read and respond to this message at: https://sourceforge.net/forum/message.php?msg_id=4883858 By: daffl Hi. I'm new to ant and want to use it with cpptasks for a multi plattform and multi language project (C++ and Java using JNI) on Unix and Windows but it doesn't work with the msvc compiler (Visual Studio 2005). Using mingw also leads to an error message for c++ source code because it always seems to use the c and not the c++ compiler. My current build.xml testfile <project name="hello-world" default="compile-msvc"> <property file="build.properties"/> <!-- Load Ant tasks and types for cpp compilers from cpptasks.jar (in current directory) --> <taskdef resource="cpptasks.tasks"> <classpath> <pathelement location="cpptasks.jar"/> </classpath> </taskdef> <taskdef resource="cpptasks.types"> <classpath> <pathelement location="cpptasks.jar"/> </classpath> </taskdef> <target name="compile-msvc"> <cc outfile="test-msvc.exe" name="msvc"> <fileset dir="." includes="main.cpp" /> </cc> </target> <target name="compile-gcc"> <cc outfile="test-gcc.exe" name="g++"> <fileset dir="." includes="main.cpp" /> </cc> </target> </project> ant compile-msvc always leads to Total time: 1 second F:\build>ant compile-msvc Buildfile: build.xml compile-msvc: [cc] 1 total files to be compiled. BUILD FAILED F:\build\build.xml:16: cl failed with return code -1073741515 Total time: 1 second and compile-gcc results in some linker errors from the gnu c linker for c++ files (but works with c source). Is there a way to view the compiler and linker command lines? Thanks Daff ______________________________________________________________________ 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 |
From: SourceForge.net <no...@so...> - 2008-04-09 13:41:30
|
Read and respond to this message at: https://sourceforge.net/forum/message.php?msg_id=4894799 By: daffl Hm, should have tried this batch file before running ant: %VS80COMNTOOLS%vsvars32.bat echo %VCINSTALLDIR% After that it works. Strange thing is, that an exec from within the build skript doesn't set the environment variables for ant: <target name="init_win32" if="is_win32"> <property environment="env" /> <property name="compiler" value="msvc" /> <property name="vsvars32" value="${env.VS80COMNTOOLS}vsvars32.bat" /> <echo>Loading Visual Studio environment variables (from ${vsvars32})</echo> <exec executable="${vsvars32}" /> <echo>${env.VCINSTALLDIR}</echo> </target> ______________________________________________________________________ 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 |
From: SourceForge.net <no...@so...> - 2008-04-09 18:23:16
|
Read and respond to this message at: https://sourceforge.net/forum/message.php?msg_id=4895433 By: darius42 The exec task spawns a child process and that child process cannot affect the environment of the parent (ant) process. ______________________________________________________________________ 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 |
From: SourceForge.net <no...@so...> - 2008-04-10 06:20:32
|
Read and respond to this message at: https://sourceforge.net/forum/message.php?msg_id=4896389 By: daffl Thanks thats what I feared. Ok... think I have to write a batch file for windows which sets the environment and then calls ant. ______________________________________________________________________ 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 |