I am trying to include a Fortran package Ain my VC++ projectd (visual studio 2008). The Fortran package calls BLAS/LAPACK routines.
I use Intel Fortran compiler 11.1.065to compile the package and generate static library A.lib. The properties in Fortran project are set as:
Runtime Library: "Debug Multithread DLL (/libs:dll /threads /dbglibs)"
Use Intel Math Kernel Library: "Parallel(/Qmkl:parallel)"
In VC++ project, A.lib is added as dependency. In C/C++ Code Generation property, I chose runtime library as "Multi-threaded Debug DLL (/MDd)", which is consistent to the Fortran project. The main.cc in successfully compiled and linked. However, when I try to run it there is runtime error:
"The application was unable to start correctly (0xc000007b). Click OK to close the application. "
However, if I keep the settings the same, but do not use Intel Math Kernel Library ("No"). The BLAS/LAPACK Fortran source codes are directlyincluded and compiled to generate A.lib. Using thisA.lib without MKL there is no runtime error in the VC++ project.
Since the difference is using and not using MKL, I would assume the runtime error is caused by something related to MKL.
A thread at Microsoft forum says [0xc000007b isSTATUS_INVALID_IMAGE_FORMAT - "The application or DLL %hs is not a valid Windows image.Please check this against your installation diskette." This suggests some file got corrupted and was not able to be interpreted as an executable file, for some reason.]
I guess the reason you are seeing the error is that wrong DLL is found; which mayoccur, for example, ifa 32-bit applicationlooks for DLLsin mkl/intel64/bin (path to dlls should be present in environment variable PATH when the application is run). The easiest way to know what the PATH is, is to insert something like this in your main() program:
and lookat the printout, it should contain this for 32-bit application
or this for 64-bit application
There is also dependency walker tool that may help to identify the problem. If "depends.exe" is not found in your MS VC installation, you could get it from here.
I hope this information will help you.
There are no automatic ways to do
that under Microsoft Visual Studio*
IDE ( from command line you can just
Please look at the MKL User's Guide ( see Chapter 10,Creating, Configuring, and Running the Intel C/C++ and/or Visual C++* 2008 Project ). May it will help you.