Migrate from GitHub to SourceForge with this tool. Check out all of SourceForge's recent improvements.
Close

#329 <midl> task fails on IDL files without a type library

0.85
closed-fixed
Tasks (408)
5
2005-03-11
2005-03-10
Grarl
No

If my IDL file only contains interface definitions and does
not output a type library file, the <midl> task will give an
exception complaining that path2 is empty.

To fix this change the following two files:

In MidlTask.cs change:
if (NeedsCompiling(Tlb)) {
return true;
} else if (Header != null && NeedsCompiling
(Header)) {
to:
if (Tlb != null && NeedsCompiling(Tlb)) {
return true;
} else if (Header != null && NeedsCompiling
(Header)) {

And in VcProject.cs change:
string typeLibraryName =
fileConfig.GetToolSetting(compilerTool,
"TypeLibraryName", "$(IntDir)/
$(ProjectName).tlb");
midlTask.Tlb = new FileInfo
(FileUtils.CombinePaths(fileConfig.ProjectDir.FullName,

typeLibraryName));
}
to:
string typeLibraryName =
fileConfig.GetToolSetting(compilerTool,
"TypeLibraryName", "$(IntDir)/
$(ProjectName).tlb");
if (typeLibraryName !=
null) {

midlTask.Tlb = new FileInfo
(FileUtils.CombinePaths(fileConfig.ProjectDir.FullName,

typeLibraryName));
}

Discussion

  • Gert Driesen

    Gert Driesen - 2005-03-10

    Logged In: YES
    user_id=707851

    Can you attach a small repro to this bug report ?

    Thanks !

     
  • Grarl

    Grarl - 2005-03-11

    NAnt build script

     
  • Grarl

    Grarl - 2005-03-11

    VS project file with settings to illustrate the problem

     
  • Grarl

    Grarl - 2005-03-11

    IDL file with interfaces only

     
  • Grarl

    Grarl - 2005-03-11

    IDL file with typelib only

     
  • Grarl

    Grarl - 2005-03-11

    Logged In: YES
    user_id=1235618

    Ok, I've uploaded files that should allow you to reproduce the
    problem.
    It seems this only happens if I have more than one IDL file in
    the project.
    Just copy these 4 files into the same folder and run NAnt in
    that folder. You should get the exception described above.
    Let me know if I can assist further.
    Thanks!

     
  • Gert Driesen

    Gert Driesen - 2005-03-11
    • milestone: --> 0.85
    • assigned_to: nobody --> drieseng
    • status: open --> closed-fixed
     
  • Gert Driesen

    Gert Driesen - 2005-03-11

    Logged In: YES
    user_id=707851

    This issue is now fixed in cvs.

    Thanks for the report and the repro !!

     

Log in to post a comment.