I have a problem in CVI 2010 when it tries to run the MIDL compiler. When CVI runs the compiler, it displays the message:
Error generating type library. Midl.exe failed while compiling the odl file used to create the type library.
Note: The error indicates that the odl file has unknown types. This error is possible when
functions with non-standard types are exported using the export qualifier method from files in
release configuration that have not been recompiled during the build process. You can mark all
files for recompilation and repeat the build. To avoid this situation, it is recommended that
you export these functions using the include file method.
Use the generated odl file "c:\TEMP\TEST\Modules\3010\3010CVI\CVI2010\af3010_32.odl" with the command line:
c:\program files (x86)\national instruments\cvi2010\sdk\bin\midl.exe "c:\TEMP\TEST\Modules\3010\3010CVI\CVI2010\af3010_32.odl" /win32 /mktyplib203 /tlb "af3010_32.tlb" /Ic:\program files (x86)\national instruments\cvi2010\sdk\include /cpp_cmd c:\program files (x86)\national instruments\cvi2010\bin\preprocessor.exe
to see what errors midl.exe reported.
When I run the command-line, it displays the following:
midl : command line warning MIDL1009 : unknown argument ignored "files"
midl : command line warning MIDL1009 : unknown argument ignored "(x86)\national"
midl : command line warning MIDL1009 : unknown argument ignored "instruments\cvi2010\sdk\include"
midl : command line warning MIDL1009 : unknown argument ignored "files"
midl : command line warning MIDL1009 : unknown argument ignored "(x86)\national"
midl : command line warning MIDL1009 : unknown argument ignored "instruments\cvi2010\bin\preprocessor.exe"
Processing c:\TEMP\TEST\Modules\3010\3010CVI\CVI2010\af3010_32.odl
midl : command line error MIDL1004 : cannot execute C preprocessor c:\program
This clearly indicates that there are missing " marks round the arguments and when I add these to the command line, it works fine, so it appears that CVI is not quoting the arguments correctly iwhen it runs the MIDL compiler.
The strange thing is that this only happens on a new PC that has recently been built. I have another Win7/64-bit system with exactly the same version of CVI 2010 which works fine. I have also checked the CVI2010 folder contents (recursively) on both PCs and they are identical, so there must be some difference in the configuration to cause this.
Rob.