Hello,

I am trying to compile a c++.net dll that is actually a wrapper of a c++
dll. The wrapper will be later referenced within a c# application. I am
fairly new to nant and having trouble with the config.build. Any suggestions
as to what it should look like?

I've seen a couple of other posts, but they never come to resolution
unfortunately.

Here is an old example I have been referencing:
http://www.mail-archive.com/nant-users@lists.sourceforge.net/msg03924.html

Here's what I have so far:
  <target name="DLL_Wrapper" options="/clr">
    <cl outputdir="${out.dir}\DLL_Wrapper.dll" verbose="true"
        options='/Od /FD /EHa /MDd /Yc"c:\DLL_Wrapper\stdafx.h"
/Fo"c:\DLL_Wrapper\Debug\\" /Fd"c:\DLL_Wrapper\Debug\vc80.pdb" /W3 /c /Zi
/clr /TP /FU "c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.dll" /FU
"c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.Data.dll" /FU
"c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.XML.dll'
        pchfile="c:\DLL_Wrapper\Debug\DLL_Wrapper.pch">
      <sources>
        <include name="c:\DLL_Wrapper\*.cpp" />
      </sources>
      <defines>
        <define name="WIN32"/>
        <define name="_DEBUG"/>
        <define name="_WINDLL"/>
        <define name="_UNICODE"/>
        <define name="UNICODE"/>
      </defines>
    </cl>
    <rc rcfile="c:\DLL_Wrapper\app.rc"
output="c:\DLL_Wrapper\Debug\app.res">
      <defines>
        <define name="_UNICODE"/>
        <define name="UNICODE"/>
      </defines>    
    </rc>
  </target>

The output:
NAnt 0.85 (Build 0.85.2311.0; nightly; 4/30/2006)
Copyright (C) 2001-2006 Gerry Shaw
http://nant.sourceforge.net

Buildfile: file:///C:/src/ProjectBase/default.build
Target framework: Microsoft .NET Framework 2.0
Target(s) specified: DLL_Wrapper 

DLL_Wrapper:

       [cl]
'C:\src\ProjectBase\CompiledDLLs\DLL_Wrapper.dll\AssemblyInfo.obj' does not
exist, recompiling.
       [cl]
'C:\src\ProjectBase\CompiledDLLs\DLL_Wrapper.dll\DLL_Wrapper.obj' does not
exist, recompiling.
       [cl] 'C:\src\ProjectBase\CompiledDLLs\DLL_Wrapper.dll\Stdafx.obj'
does not exist, recompiling.
       [cl] Compiling 3 files to
'C:\src\ProjectBase\CompiledDLLs\DLL_Wrapper.dll'.
       [cl] Contents of C:\Documents and Settings\fa806b\Local
Settings\Temp\tmp325.tmp.
       [cl] /c
       [cl] /Od /FD /EHa /MDd /Yc"c:\DLL_Wrapper\stdafx.h"
/Fo"c:\DLL_Wrapper\Debug\\" /Fd"c:\DLL_Wrapper\Debug\vc80.pdb" /W3 /c /Zi
/clr /TP /FU "c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.dll" /FU
"c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.Data.dll" /FU
"c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.XML.dll
       [cl] /D "WIN32"
       [cl] /D "_DEBUG"
       [cl] /D "_WINDLL"
       [cl] /D "_UNICODE"
       [cl] /D "UNICODE"
       [cl] /Fd"C:\src\ProjectBase\CompiledDLLs\DLL_Wrapper.dll/"
       [cl] /Fo"C:\src\ProjectBase\CompiledDLLs\DLL_Wrapper.dll/"
       [cl] /Fp"c:\DLL_Wrapper\Debug\DLL_Wrapper.pch"
       [cl] /Yu"C:\DLL_Wrapper\AssemblyInfo.cpp"
       [cl] "C:\DLL_Wrapper\DLL_Wrapper.cpp"
       [cl] "C:\DLL_Wrapper\Stdafx.cpp"
       [cl] 
       [cl] Starting 'cl (@"C:\Documents and Settings\bob\Local
Settings\Temp\tmp325.tmp" /nologo)' in 'C:\src\ProjectBase'
       [cl] cl : Command line warning D9025 : overriding
'/Fdc:\DLL_Wrapper\Debug\vc80.pdb' with
'/FdC:\src\ProjectBase\CompiledDLLs\DLL_Wrapper.dll/'
       [cl] cl : Command line warning D9025 : overriding
'/Foc:\DLL_Wrapper\Debug\' with
'/FoC:\src\ProjectBase\CompiledDLLs\DLL_Wrapper.dll/'
       [cl] DLL_Wrapper.cpp
       [cl] C:\DLL_Wrapper\DLL_Wrapper.cpp : fatal error C1195: use of /Yu
and /Yc on the same command line is incompatible with the /clr option
       [cl] Stdafx.cpp
       [cl] C:\DLL_Wrapper\Stdafx.cpp : fatal error C1195: use of /Yu and
/Yc on the same command line is incompatible with the /clr option

BUILD FAILED - 0 non-fatal error(s), 2 warning(s)

C:\src\ProjectBase\default.build(315,6):
External Program Failed: cl (return code was 2)

Total time: 0.4 seconds.


-- 
View this message in context: 
http://www.nabble.com/nant-c%2B%2B.net-dll-configuration-tf3022932.html#a8396950
Sent from the NAnt - Users mailing list archive at Nabble.com.


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
NAnt-users mailing list
NAnt-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nant-users

Reply via email to