Thank you,
 
I did not know I had to compile the .rc first with another compiler. So the complete compiling of a dll with resouce info looks in fact like this:
 
<target name="compile">
    <!-- Compile the version info -->
    <cc name="msrc" objdir="${build.basedir}">
        <fileset dir="${c.src.dir}">
            <include name="*.rc"/>
        </fileset>    
    </cc>
    <!-- Compile the actual source -->
        <cc name="msvc" outtype="shared" debug="true" objdir="${build.basedir}" outfile="${basedir}/distrib/name_of_the_dll">
           <libset dir="${path.to.a.lib.file}" libs="mylib"/>
           <libset libs="version"/>
           <libset libs="user32"/>
           <libset libs="gdi32"/>
           <includepath path="${path.to.header.file}/>
           <fileset dir="${c.src.dir}">
               <include name="*.c"/>
               <include name="*.cpp"/>
           </fileset>
           <fileset dir="${build.basedir}">
               <include name="*.res"/>
           </fileset>
      </cc>
 </target>
 
Maybe you can put this on the help pages, because I find the info I find on the cc task very small. Maybe another tip to put on the webpage is how to use the cctasks without putting the jar in the lib directory of the ant installation. I found that it works if you do this:
 
<!-- Defines for the cc task -->
 <property name="cpptasks.jar.location" value="insert path to cpptasks.jar here"/>
 <taskdef name="cc" classname="net.sf.antcontrib.cpptasks.CCTask">
  <classpath>
   <pathelement location="${cpptasks.jar.location}"/>
  </classpath>
 </taskdef>
 <typedef name="defineset" classname="net.sf.antcontrib.cpptasks.types.DefineSet">
  <classpath>
   <pathelement location="${cpptasks.jar.location}"/>
  </classpath>
 </typedef>
 <typedef name="compiler" classname="net.sf.antcontrib.cpptasks.CompilerDef">
  <classpath>
   <pathelement location="${cpptasks.jar.location}"/>
  </classpath>
 </typedef>
 <typedef name="linker" classname="net.sf.antcontrib.cpptasks.LinkerDef">
  <classpath>
   <pathelement location="${cpptasks.jar.location}"/>
  </classpath>
 </typedef>
 <typedef name="targetplatform" classname="net.sf.antcontrib.cpptasks.TargetDef">
  <classpath>
   <pathelement location="${cpptasks.jar.location}"/>
  </classpath>
 </typedef>
 <typedef name="versioninfo" classname="net.sf.antcontrib.cpptasks.VersionInfo">
  <classpath>
   <pathelement location="${cpptasks.jar.location}"/>
  </classpath>
 </typedef>
 <typedef name="distributer" classname="net.sf.antcontrib.cpptasks.DistributerDef">
  <classpath>
   <pathelement location="${cpptasks.jar.location}"/>
  </classpath>
 </typedef>
 
I agree that it takes much more space in your build file, but I like to keep my ant lib directory "clean".
 
Anyway, thank you for the help.
 
regards,
 
Wim
-----Original Message-----
From: Dominique Devienne [mailto:DDevienne@lgc.com]
Sent: 22 nov 04 17:54
To: Deblauwe, Wim; ant-contrib-developers@lists.sourceforge.net
Subject: RE: [Ant-contrib-developers] Include version info in dll with cc task

See below. Note that CVS head also has a <versioninfo> tag, which still requires to have an explicit msrc compiler, but I couldn’t make it work for me. But since you have a .rc file already, what’s below is enough. –DD

PS: Note that win32 is a property I set only on Windows somewhere else.

 

    <cc ... xmlns="antlib:net.sf.antcontrib.cpptasks">

      ...

      <compiler name="msrc" if="win32">

        <fileset file=".../version.rc" />

      </compiler>

    </cc>

 

-----Original Message-----
From: ant-contrib-developers-admin@lists.sourceforge.net [mailto:ant-contrib-developers-admin@lists.sourceforge.net] On Behalf Of Deblauwe, Wim
Sent: Monday, November 22, 2004 10:08 AM
To: 'ant-contrib-developers@lists.sourceforge.net'
Subject: [Ant-contrib-developers] Include version info in dll with cc task

 

How do I include version information in a dll with the cc task? I have a .rc file containing the version info of the dll.