链接已复制
Please explain in more detail what you are trying to do (attaching a ZIP of the buildlog.htm from the failed build would be helpful.)
I hope that you are aware that one does not link to DLLs - instead you link to the export library (.LIB) created when the DLL was built. If you don't have that, you will need to use dynamic loading - a worked example is provided in the Intel Fortran samples as DLL\DynamicLoad.
Thank you for your response, Steve.
The code is linked to export library as shown in the attached pictures; however, it is not working since the .dd files are missed. My problem is that how can I define the path to .dll files in Fortran. I was successful to run this code by pasting all the required .dll files in the code folder but it is a messy way to do this. Attached, there is a copy of the code.
Steve Lionel (Ret.) wrote:
Please explain in more detail what you are trying to do (attaching a ZIP of the buildlog.htm from the failed build would be helpful.)
I hope that you are aware that one does not link to DLLs - instead you link to the export library (.LIB) created when the DLL was built. If you don't have that, you will need to use dynamic loading - a worked example is provided in the Intel Fortran samples as DLL\DynamicLoad.
Windows has rules for how it locates DLLs at run-time - this isn't something you do in Fortran. The order is (if I have this right):
- The current directory
- The directory containing the EXE
- Directories named in the PATH environment variable
- The Windows directory
- The Windows\System32 directory
Typically people copy DLLs into the same folder as the exe for use when the exe is run.
even If the PATH is set to the folder of .dll files, the code gives the same error.
Steve Lionel (Ret.) wrote:
Windows has rules for how it locates DLLs at run-time - this isn't something you do in Fortran. The order is (if I have this right):
- The current directory
- The directory containing the EXE
- Directories named in the PATH environment variable
- The Windows directory
- The Windows\System32 directory
Typically people copy DLLs into the same folder as the exe for use when the exe is run.
So where is libmat.dll? And is it a 32-bit or 64-bit DLL?
Download Dependency Walker . Run it from the command line while in the directory with the EXE and have it open your EXE. Does it show any missing DLLs? (Ignore "delay-load" messages.)
There are two versions(32&64) of Matlab installed on this computer(64). Dlls are located here "C:\MATLAB_32bits\bin\win32". The result of using Dependency Walker is attached.
Steve Lionel (Ret.) wrote:
So where is libmat.dll? And is it a 32-bit or 64-bit DLL?
Download Dependency Walker . Run it from the command line while in the directory with the EXE and have it open your EXE. Does it show any missing DLLs? (Ignore "delay-load" messages.)
C:\MATLAB_32bits\bin\; is in the PATH but still doesn't work.
mecej4 wrote:
You need to add the Matlab bin\<arch> directory to PATH before attempting to run the EXE that is produced by linking with libmx.lib and libmat.lib.
Sorry, the address is set to C:\MATLAB_32bits\bin\win32 in my system. The address was not written correctly before.
mecej4 wrote:
Quote:
Vahid H. wrote:
C:\MATLAB_32bits\bin\; is in the PATH but still doesn't work.
That path component is incomplete; it should be C:\MATLAB_32bits\bin\win32 .
