News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

MIDL Error

Started by Robert Collins, July 14, 2005, 01:19:16 AM

Previous topic - Next topic

Robert Collins

I am trying to build (or compile, if that is what it is called) an .IDL file using MIDL.EXE. Now, the IDL file has an import statement like this:

import "unknwn.idl";


The file unknwn.idl is in both the VC98\Include directory and the directory where the IDL file is that I am building.

I get the following error:


  command line error MIDL1001 cannot open input file unknwn.idl


If the file is in the VC98\include and the working directory I assume that this error message is not because the file can't be found.

I looked the error number up at MSDN and it simply said this:

Preprocessor Errors
 
The following error messages are generated during preprocessing:
  '
  '
MIDL1001: cannot open input file
The specified input file could not be opened.
  '
  '


A lot of help that is!

Anyone have any idea what could cause that error?


 

sluggy

You problem may be because of confusion as to what the working (local) directory is. You probably think that the local directory is the one containing the idl file (which is a reasonable assumption), but i bet that the local directory is actually the one that midl is running from.

Either put the include file in the same folder as midl.exe, or add the folder to the PATH envvar. As a last resort you could fully qualify the path name in the include statement.  :U

Robert Collins

OK, problem solved. There were two problems. One was like you said, sluggy. Just to make it all simple I put everything in the same directory (I didn't want to get into this PATH thingy). That solved the 1st problem about the error message command line error MIDL1001 cannot open input file unknwn.idl. After I got it to compile I encountered a second error: midl\oleaut32.dll : error MIDL2020 : error generating type library : SaveAllChanges Failed . Well, that one was resolved by removing the Read Only attribute from the IDL file.

All is good for now. Thanks, sluggy for your quidence.