You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Jason Rizer <ja...@yahoo.com> on 2002/12/08 21:59:59 UTC

Trouble compiling native code using exec

Hello,

I've used ant on several projects and really love it. 
I'm in the process now of converting an existing build
process to ant.  Unfortunately, this project has a
small native component written in C++ and compiled
with the compiler bundled with the Microsoft Visual
Studio.  I'm trying to do the compile using the exec
task as follows:

  <!--
===================================================================
-->
  <!-- Build the native Driver                        
            -->
  <!--
===================================================================
-->
  <target name="build_native_driver"
depends="construct_build_directory" >
    <exec
executable="${msdev.dir}\common\MSDev98\bin\msdev"
failonerror="yes" dir="${driver.dir}">
      <arg line="NativeDriver.dsw /USEENV /MAKE
'NativeDriver - Release' /REBUILD /NORECURSE"/>
      <env key="lib"
value="${msdev.dir}\vc98\Lib;${msdev.dir}\vc98\MFC\Lib;${db.api.dir}\lib;${3psrc.dir}\icu\icu14\icu\lib\Release;${3psrc.dir}\xml\xml4csrc3_1_0\build\win32\VC6\Release"/>
      <env key="include"
value="${msdev.dir}\vc98\Include;${msdev.dir}\vc98\MFC\Include;${msdev.dir}\vc98\ATL\Include;${db.api.dir}\Include;${jdk131.dir}\include;${jdk131.dir}\include\win32;${3psrc.dir}\icu\icu14\icu\include;${3psrc.dir}\xml\xml4csrc3_1_0\include;${db.java.dir}\common;${db.java.dir}\driver"/>
      <env key="path"
value="${msdev.dir}\VC98\Bin;${msdev.dir}\Common\MSDev98\bin"/>

    </exec> 
  </target> 

When I run ant I get the following error:

     [exec] Compiling resources...
     [exec] Compiling...
     [exec] Error spawning cl.exe

     [exec] NativeDriver.dll - 1 error(s), 0
warning(s)

BUILD FAILED
file:C:/projects/MyBuild.xml:84: exec returned: 1

I'm able to run msdev.exe from the dos command line
without any problems.  I'm running this on Win2000 and
using ant 1.5.  So my questions are then:

1.  Is there a custom task anywhere for the Microsoft
Compiler?

2.  If not has anyone been successful using the exec
task for this purpose?

3.  Anyone have any general thoughts on what may be
causing this problem?

Thanks in advance for any ideas anyone may have.

-Jason 


__________________________________________________
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Trouble compiling native code using exec

Posted by Steve Loughran <st...@iseran.com>.
----- Original Message -----
From: "Jason Rizer" <ja...@yahoo.com>
To: "Ant Users List" <an...@jakarta.apache.org>
Sent: Sunday, December 08, 2002 12:59
Subject: Trouble compiling native code using exec


>       <env key="lib"
>
value="${msdev.dir}\vc98\Lib;${msdev.dir}\vc98\MFC\Lib;${db.api.dir}\lib;${3
psrc.dir}\icu\icu14\icu\lib\Release;${3psrc.dir}\xml\xml4csrc3_1_0\build\win
32\VC6\Release"/>
>       <env key="include"
>
value="${msdev.dir}\vc98\Include;${msdev.dir}\vc98\MFC\Include;${msdev.dir}\
vc98\ATL\Include;${db.api.dir}\Include;${jdk131.dir}\include;${jdk131.dir}\i
nclude\win32;${3psrc.dir}\icu\icu14\icu\include;${3psrc.dir}\xml\xml4csrc3_1
_0\include;${db.java.dir}\common;${db.java.dir}\driver"/>
>       <env key="path"
> value="${msdev.dir}\VC98\Bin;${msdev.dir}\Common\MSDev98\bin"/>

you need to get the case of these LIB, INCLUDE and either Path or PATH,
depending on OS.

> 1.  Is there a custom task anywhere for the Microsoft
> Compiler?

<cc> on ant-contrib.sf.net


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>