I build wxWidgets application with DialogBlocks on Windows 7 with VS2005 installed. Build is successful, but executable doesn't run giving the message: "The program can't start because MSVCR80D.dll is missing from your computer". The same code built in Visual Studio is OK. Build log:
----------------------- Configuration: VC++ Debug -----------------------
In directory: C:\Users\alexm\Documents\DialogBlocks Projects\Test1
nmake /nologo -f makefile.vc CONFIG=debug clean all
if exist VCDebug\*.obj del VCDebug\*.obj
if exist VCDebug\*.res del VCDebug\*.res
if exist VCDebug\Test11.exe del VCDebug\Test11.exe
if exist VCDebug\Test11.ilk del VCDebug\Test11.ilk
if exist VCDebug\Test11.pdb del VCDebug\Test11.pdb
cl.exe /c /nologo /TP /FoVCDebug\mainframe.obj /DNOPCH /DWIN32 /D__WXMSW__ /D_WINDOWS /D__WXDEBUG__ /D_DEBUG /Zi /MDd /Od /GR /EHsc /W4 /I"C:\wxWidgets-2.8.10/include" /I"C:\wxWidgets-2.8.10/contrib/include" /I"C:\wxWidgets-2.8.10/lib/vc_lib/mswd" /I"C:\Program Files (x86)\Microsoft Visual Studio 8\vc\include" /I"C:\Program Files (x86)\Microsoft Visual Studio 8\vc\PlatformSDK\include" mainframe.cpp
mainframe.cpp
cl.exe /c /nologo /TP /FoVCDebug\test11app.obj /DNOPCH /DWIN32 /D__WXMSW__ /D_WINDOWS /D__WXDEBUG__ /D_DEBUG /Zi /MDd /Od /GR /EHsc /W4 /I"C:\wxWidgets-2.8.10/include" /I"C:\wxWidgets-2.8.10/contrib/include" /I"C:\wxWidgets-2.8.10/lib/vc_lib/mswd" /I"C:\Program Files (x86)\Microsoft Visual Studio 8\vc\include" /I"C:\Program Files (x86)\Microsoft Visual Studio 8\vc\PlatformSDK\include" test11app.cpp
test11app.cpp
rc.exe /foVCDebug\Test11.res /DNOPCH /DWIN32 /D__WXMSW__ /D_WINDOWS /D__WXDEBUG__ /D_DEBUG /I "C:\wxWidgets-2.8.10/include" /I "C:\wxWidgets-2.8.10/contrib/include" /I "C:\wxWidgets-2.8.10/lib/vc_lib/mswd" /I "C:\Program Files (x86)\Microsoft Visual Studio 8\vc\include" /I "C:\Program Files (x86)\Microsoft Visual Studio 8\vc\PlatformSDK\include" Test11.rc
link.exe /OUT:VCDebug\Test11.exe /LIBPATH:"C:\wxWidgets-2.8.10/lib/vc_lib" /LIBPATH:"C:\Program Files (x86)\Microsoft Visual Studio 8\vc\lib" /LIBPATH:"C:\Program Files (x86)\Microsoft Visual Studio 8\vc\PlatformSDK\lib" /nologo /SUBSYSTEM:WINDOWS /machine:i386 /DEBUG VCDebug\mainframe.obj VCDebug\test11app.obj VCDebug\Test11.res wxmsw28d_richtext.lib wxmsw28d_aui.lib wxmsw28d_html.lib wxmsw28d_xrc.lib wxmsw28d_core.lib wxbase28d.lib wxtiffd.lib wxjpegd.lib wxpngd.lib wxzlibd.lib wxregexd.lib wxmsw28d_adv.lib wxmsw28d_html.lib wxmsw28d_xrc.lib wxbase28d_net.lib wxbase28d_xml.lib wxexpatd.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib comctl32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib wsock32.lib
link.exe /OUT:VCDebug\Test11.exe /LIBPATH:"C:\wxWidgets-2.8.10/lib/vc_lib" /LIBPATH:"C:\Program Files (x86)\Microsoft Visual Studio 8\vc\lib" /LIBPATH:"C:\Program Files (x86)\Microsoft Visual Studio 8\vc\PlatformSDK\lib" /nologo /SUBSYSTEM:WINDOWS /machine:i386 /DEBUG #C:\Users\alexm\AppData\Local\Temp\nmB05C.tmp
Done.
0 errors, 0 warnings
Manifest file:
<?xml version='1.0' encoding='UTF-8' standalone='yes'?>
<assembly xmlns='urn:schemas-microsoft-com:asm.v1' manifestVersion='1.0'>
<dependency>
<dependentAssembly>
<assemblyIdentity type='win32' name='Microsoft.VC80.DebugCRT' version='8.0.50727.762' processorArchitecture='x86' publicKeyToken='1fc8b3b9a1e18e3b' />
</dependentAssembly>
</dependency>
<dependency>
<dependentAssembly>
<assemblyIdentity type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='x86' publicKeyToken='6595b64144ccf1df' language='*' />
</dependentAssembly>
</dependency>
<dependency>
<dependentAssembly>
<assemblyIdentity type='win32' name='Microsoft.VC80.CRT' version='8.0.50727.762' processorArchitecture='x86' publicKeyToken='1fc8b3b9a1e18e3b' />
</dependentAssembly>
</dependency>
</assembly>
Can I change some compiler/linker flags, or make some change on my computer, to allow this executable to run?
The case is that compiler cl.exe have been provided with /MDd flag that tells him to link against shared library versions. Try /MTd instead.
The problem might have been arisen because of wxWidgets libraries if they were built with shared runtime. Usually you are not permitted to build projects with different versions of vc runtime. In that case you could explore whether wxWidgets provides libs built with static runtime or not. Often they do.
Just to be clear. You are not permitted to link binaries against libraries and objects files if they were compiled involving different versions of vc runtime. On my machine i've got MSVS 2005 but i've got slightly different version of CRT debug runtime.
<assemblyIdentity type="win32" name="Microsoft.VC80.DebugCRT" version="8.0.50608.0" processorArchitecture="x86" publicKeyToken="1fc8b3b9a1e18e3b" />
One possible reason is that you either on the other hand library authors have had MSVS 2005 SP1 installed.
HTH.
Related
This question already has answers here:
CMake cannot open "ucrtd.lib"
(3 answers)
Closed 11 months ago.
I downloaded vscode with (C/C++ and cmake extentions) and Visual Studio Tools 2022. Created and QuickStart project with the cmake extention which is a simple:
#include <iostream>
int main(int, char**) {
std::cout << "Hello, world!\n";
}
cmake_minimum_required(VERSION 3.0.0)
project(hello-cmake VERSION 0.1.0)
include(CTest)
enable_testing()
add_executable(hello-cmake main.cpp)
set(CPACK_PROJECT_NAME ${PROJECT_NAME})
set(CPACK_PROJECT_VERSION ${PROJECT_VERSION})
include(CPack)
but I keep getting this error:
[variant] Loaded new set of variants
[kit] Successfully loaded 4 kits from C:\Users\Will\AppData\Local\CMakeTools\cmake-tools-kits.json
[visual-studio] Patch Windows SDK bin path from C:\Program Files (x86)\Windows Kits\10\bin\x86 to C:\Program Files (x86)\Windows Kits\10\bin\10.0.19041.0\x86 for C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Auxiliary\Build\vcvarsall.bat
[proc] Executing command: "C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin\cmake.exe" -Sc:/Users/Will/source/hello-cmake -Bc:/Users/Will/source/hello-cmake/build -G "Visual Studio 17 2022"
[main] Configuring folder: hello-cmake
[proc] Executing command: "C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin\cmake.exe" --no-warn-unused-cli -DCMAKE_EXPORT_COMPILE_COMMANDS:BOOL=TRUE -Sc:/Users/Will/source/hello-cmake -Bc:/Users/Will/source/hello-cmake/build -G "Visual Studio 17 2022"
[cmake] Not searching for unused variables given on the command line.
[cmake] -- Selecting Windows SDK version 10.0.19041.0 to target Windows 10.0.19044.
[cmake] -- The C compiler identification is unknown
[cmake] -- The CXX compiler identification is unknown
[cmake] CMake Error at CMakeLists.txt:2 (project):
[cmake] No CMAKE_C_COMPILER could be found.
[cmake]
[cmake]
[cmake]
[cmake] CMake Error at CMakeLists.txt:2 (project):
[cmake] No CMAKE_CXX_COMPILER could be found.
[cmake]
[cmake]
[cmake]
[cmake] -- Configuring incomplete, errors occurred!
[cmake] See also "C:/Users/Will/source/hello-cmake/build/CMakeFiles/CMakeOutput.log".
[cmake] See also "C:/Users/Will/source/hello-cmake/build/CMakeFiles/CMakeError.log".
[visual-studio] Patch Windows SDK bin path from C:\Program Files (x86)\Windows Kits\10\bin\x86 to C:\Program Files (x86)\Windows Kits\10\bin\10.0.19041.0\x86 for C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Auxiliary\Build\vcvarsall.bat
this is the CMakeError
Compiling the C compiler identification source file "CMakeCCompilerId.c" failed.
Compiler:
Build flags:
Id flags:
The output was:
1
Microsoft (R) Build Engine version 17.1.0+ae57d105c for .NET Framework
Copyright (C) Microsoft Corporation. All rights reserved.
Build started 4/1/2022 5:43:21 PM.
Project "C:\Users\Will\source\hello-cmake\build\CMakeFiles\3.22.22022201-MSVC_2\CompilerIdC\CompilerIdC.vcxproj" on node 1 (default targets).
PrepareForBuild:
Creating directory "Debug\".
Creating directory "Debug\CompilerIdC.tlog\".
InitializeBuildStatus:
Creating "Debug\CompilerIdC.tlog\unsuccessfulbuild" because "AlwaysCreate" was specified.
ClCompile:
C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.31.31103\bin\HostX64\x64\CL.exe /c /nologo /W0 /WX- /diagnostics:column /Od /D _MBCS /Gm- /EHsc /RTC1 /MDd /GS /fp:precise /Zc:wchar_t /Zc:forScope /Zc:inline /Fo"Debug\\" /Fd"Debug\vc143.pdb" /external:W0 /Gd /TC /FC /errorReport:queue CMakeCCompilerId.c
CMakeCCompilerId.c
Link:
C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.31.31103\bin\HostX64\x64\link.exe /ERRORREPORT:QUEUE /OUT:".\CompilerIdC.exe" /INCREMENTAL:NO /NOLOGO kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /MANIFEST /MANIFESTUAC:"level='asInvoker' uiAccess='false'" /manifest:embed /PDB:".\CompilerIdC.pdb" /SUBSYSTEM:CONSOLE /TLBID:1 /DYNAMICBASE /NXCOMPAT /IMPLIB:".\CompilerIdC.lib" /MACHINE:X64 Debug\CMakeCCompilerId.obj
LINK : fatal error LNK1104: cannot open file 'ucrtd.lib' [C:\Users\Will\source\hello-cmake\build\CMakeFiles\3.22.22022201-MSVC_2\CompilerIdC\CompilerIdC.vcxproj]
Done Building Project "C:\Users\Will\source\hello-cmake\build\CMakeFiles\3.22.22022201-MSVC_2\CompilerIdC\CompilerIdC.vcxproj" (default targets) -- FAILED.
Build FAILED.
"C:\Users\Will\source\hello-cmake\build\CMakeFiles\3.22.22022201-MSVC_2\CompilerIdC\CompilerIdC.vcxproj" (default target) (1) ->
(Link target) ->
LINK : fatal error LNK1104: cannot open file 'ucrtd.lib' [C:\Users\Will\source\hello-cmake\build\CMakeFiles\3.22.22022201-MSVC_2\CompilerIdC\CompilerIdC.vcxproj]
0 Warning(s)
1 Error(s)
Time Elapsed 00:00:00.60
Compiling the C compiler identification source file "CMakeCCompilerId.c" failed.
Compiler:
Build flags:
Id flags:
The output was:
1
Microsoft (R) Build Engine version 17.1.0+ae57d105c for .NET Framework
Copyright (C) Microsoft Corporation. All rights reserved.
Build started 4/1/2022 5:43:21 PM.
Project "C:\Users\Will\source\hello-cmake\build\CMakeFiles\3.22.22022201-MSVC_2\CompilerIdC\CompilerIdC.vcxproj" on node 1 (default targets).
PrepareForBuild:
Creating directory "Debug\".
Creating directory "Debug\CompilerIdC.tlog\".
InitializeBuildStatus:
Creating "Debug\CompilerIdC.tlog\unsuccessfulbuild" because "AlwaysCreate" was specified.
ClCompile:
C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.31.31103\bin\HostX64\x64\CL.exe /c /nologo /W0 /WX- /diagnostics:column /Od /D _MBCS /Gm- /EHsc /RTC1 /MDd /GS /fp:precise /Zc:wchar_t /Zc:forScope /Zc:inline /Fo"Debug\\" /Fd"Debug\vc143.pdb" /external:W0 /Gd /TC /FC /errorReport:queue CMakeCCompilerId.c
CMakeCCompilerId.c
Link:
C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.31.31103\bin\HostX64\x64\link.exe /ERRORREPORT:QUEUE /OUT:".\CompilerIdC.exe" /INCREMENTAL:NO /NOLOGO kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /MANIFEST /MANIFESTUAC:"level='asInvoker' uiAccess='false'" /manifest:embed /PDB:".\CompilerIdC.pdb" /SUBSYSTEM:CONSOLE /TLBID:1 /DYNAMICBASE /NXCOMPAT /IMPLIB:".\CompilerIdC.lib" /MACHINE:X64 Debug\CMakeCCompilerId.obj
LINK : fatal error LNK1104: cannot open file 'ucrtd.lib' [C:\Users\Will\source\hello-cmake\build\CMakeFiles\3.22.22022201-MSVC_2\CompilerIdC\CompilerIdC.vcxproj]
Done Building Project "C:\Users\Will\source\hello-cmake\build\CMakeFiles\3.22.22022201-MSVC_2\CompilerIdC\CompilerIdC.vcxproj" (default targets) -- FAILED.
Build FAILED.
"C:\Users\Will\source\hello-cmake\build\CMakeFiles\3.22.22022201-MSVC_2\CompilerIdC\CompilerIdC.vcxproj" (default target) (1) ->
(Link target) ->
LINK : fatal error LNK1104: cannot open file 'ucrtd.lib' [C:\Users\Will\source\hello-cmake\build\CMakeFiles\3.22.22022201-MSVC_2\CompilerIdC\CompilerIdC.vcxproj]
0 Warning(s)
1 Error(s)
Time Elapsed 00:00:00.43
Compiling the CXX compiler identification source file "CMakeCXXCompilerId.cpp" failed.
Compiler:
Build flags:
Id flags:
The output was:
1
Microsoft (R) Build Engine version 17.1.0+ae57d105c for .NET Framework
Copyright (C) Microsoft Corporation. All rights reserved.
Build started 4/1/2022 5:43:22 PM.
Project "C:\Users\Will\source\hello-cmake\build\CMakeFiles\3.22.22022201-MSVC_2\CompilerIdCXX\CompilerIdCXX.vcxproj" on node 1 (default targets).
PrepareForBuild:
Creating directory "Debug\".
Creating directory "Debug\CompilerIdCXX.tlog\".
InitializeBuildStatus:
Creating "Debug\CompilerIdCXX.tlog\unsuccessfulbuild" because "AlwaysCreate" was specified.
ClCompile:
C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.31.31103\bin\HostX64\x64\CL.exe /c /nologo /W0 /WX- /diagnostics:column /Od /D _MBCS /Gm- /EHsc /RTC1 /MDd /GS /fp:precise /Zc:wchar_t /Zc:forScope /Zc:inline /Fo"Debug\\" /Fd"Debug\vc143.pdb" /external:W0 /Gd /TP /FC /errorReport:queue CMakeCXXCompilerId.cpp
CMakeCXXCompilerId.cpp
Link:
C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.31.31103\bin\HostX64\x64\link.exe /ERRORREPORT:QUEUE /OUT:".\CompilerIdCXX.exe" /INCREMENTAL:NO /NOLOGO kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /MANIFEST /MANIFESTUAC:"level='asInvoker' uiAccess='false'" /manifest:embed /PDB:".\CompilerIdCXX.pdb" /SUBSYSTEM:CONSOLE /TLBID:1 /DYNAMICBASE /NXCOMPAT /IMPLIB:".\CompilerIdCXX.lib" /MACHINE:X64 Debug\CMakeCXXCompilerId.obj
LINK : fatal error LNK1104: cannot open file 'ucrtd.lib' [C:\Users\Will\source\hello-cmake\build\CMakeFiles\3.22.22022201-MSVC_2\CompilerIdCXX\CompilerIdCXX.vcxproj]
Done Building Project "C:\Users\Will\source\hello-cmake\build\CMakeFiles\3.22.22022201-MSVC_2\CompilerIdCXX\CompilerIdCXX.vcxproj" (default targets) -- FAILED.
Build FAILED.
"C:\Users\Will\source\hello-cmake\build\CMakeFiles\3.22.22022201-MSVC_2\CompilerIdCXX\CompilerIdCXX.vcxproj" (default target) (1) ->
(Link target) ->
LINK : fatal error LNK1104: cannot open file 'ucrtd.lib' [C:\Users\Will\source\hello-cmake\build\CMakeFiles\3.22.22022201-MSVC_2\CompilerIdCXX\CompilerIdCXX.vcxproj]
0 Warning(s)
1 Error(s)
Time Elapsed 00:00:00.44
Compiling the CXX compiler identification source file "CMakeCXXCompilerId.cpp" failed.
Compiler:
Build flags:
Id flags:
The output was:
1
Microsoft (R) Build Engine version 17.1.0+ae57d105c for .NET Framework
Copyright (C) Microsoft Corporation. All rights reserved.
Build started 4/1/2022 5:43:23 PM.
Project "C:\Users\Will\source\hello-cmake\build\CMakeFiles\3.22.22022201-MSVC_2\CompilerIdCXX\CompilerIdCXX.vcxproj" on node 1 (default targets).
PrepareForBuild:
Creating directory "Debug\".
Creating directory "Debug\CompilerIdCXX.tlog\".
InitializeBuildStatus:
Creating "Debug\CompilerIdCXX.tlog\unsuccessfulbuild" because "AlwaysCreate" was specified.
ClCompile:
C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.31.31103\bin\HostX64\x64\CL.exe /c /nologo /W0 /WX- /diagnostics:column /Od /D _MBCS /Gm- /EHsc /RTC1 /MDd /GS /fp:precise /Zc:wchar_t /Zc:forScope /Zc:inline /Fo"Debug\\" /Fd"Debug\vc143.pdb" /external:W0 /Gd /TP /FC /errorReport:queue CMakeCXXCompilerId.cpp
CMakeCXXCompilerId.cpp
Link:
C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.31.31103\bin\HostX64\x64\link.exe /ERRORREPORT:QUEUE /OUT:".\CompilerIdCXX.exe" /INCREMENTAL:NO /NOLOGO kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /MANIFEST /MANIFESTUAC:"level='asInvoker' uiAccess='false'" /manifest:embed /PDB:".\CompilerIdCXX.pdb" /SUBSYSTEM:CONSOLE /TLBID:1 /DYNAMICBASE /NXCOMPAT /IMPLIB:".\CompilerIdCXX.lib" /MACHINE:X64 Debug\CMakeCXXCompilerId.obj
LINK : fatal error LNK1104: cannot open file 'ucrtd.lib' [C:\Users\Will\source\hello-cmake\build\CMakeFiles\3.22.22022201-MSVC_2\CompilerIdCXX\CompilerIdCXX.vcxproj]
Done Building Project "C:\Users\Will\source\hello-cmake\build\CMakeFiles\3.22.22022201-MSVC_2\CompilerIdCXX\CompilerIdCXX.vcxproj" (default targets) -- FAILED.
Build FAILED.
"C:\Users\Will\source\hello-cmake\build\CMakeFiles\3.22.22022201-MSVC_2\CompilerIdCXX\CompilerIdCXX.vcxproj" (default target) (1) ->
(Link target) ->
LINK : fatal error LNK1104: cannot open file 'ucrtd.lib' [C:\Users\Will\source\hello-cmake\build\CMakeFiles\3.22.22022201-MSVC_2\CompilerIdCXX\CompilerIdCXX.vcxproj]
0 Warning(s)
1 Error(s)
Time Elapsed 00:00:00.44
This is actually the answer.
https://stackoverflow.com/a/71418520/6656422
10.0.19041.0is a bad windows sdk version. I installed 10.0.20348.0 and it works no problem.
I'm trying to link Fortran code with Matlab using the Mex function. I can successfully compile and link the code using the following instruction:
mex COMPFLAGS="$COMPFLAGS -Qopenmp -Qmkl"...
'-IC:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2017.5.267\windows\mkl\include'...
'-LC:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2017.5.267\windows\mkl\lib\intel64'...
-lmkl_intel_ilp64.lib -lmkl_intel_thread.lib -lmkl_core.lib libiomp5md.lib...
ero_dep_fortran.F Module.F prepare_bank_collapse.F LINEAR_ELASTIC_STIFFNESS.F FAILURE_CRITERION.F OUTPUT.F pardisonew.F
However, when I execute the generated .mexw64 function, Matlab crashes without any error information. Then I debug my Fortran code line by line, and I found that Matlab crashes when invoking the function pardiso which comes from Intel MKL library. It seems that when invoking function from MKL, Matlab will crash and I have no idea how to fix it.
Any suggestions will be appreciated.
PS: Thanks for the help from #Evg. Finally, the following instruction works:
mex COMPFLAGS="$COMPFLAGS -Qopenmp"...
'-IC:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2017.5.267\windows\mkl\include'...
'-LC:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2017.5.267\windows\mkl\lib\intel64'...
-lmkl_intel_ilp64.lib -lmkl_intel_thread.lib -lmkl_core.lib libiomp5md.lib...
ero_dep_fortran.F Module.F prepare_bank_collapse.F LINEAR_ELASTIC_STIFFNESS.F FAILURE_CRITERION.F OUTPUT.F pardisonew.F
Previous Additions:
I also try to run the code on the Intel Parallel Studio XE 2017 compiler using makefile as:
ifort Module.F OUTPUT.F FAILURE_CRITERION.F pardisonew.F LINEAR_ELASTIC_STIFFNESS.F prepare_bank_collapse.F ero_dep_fortran.F /Qopenmp /Qmkl /nostandard-realloc-lhs /MD -o BANK_COLLAPSE.exe
The generated .exe works. So the problem is not due to the code self or the function pardiso from Intel MKL library. I guess there is something wrong when Matlab invokes pardiso, although it 'seems' to link sucessfully.
I use Matlab 2019b and Intel Parallel Studio XE 2017 for Fortran with Microsoft Visual Studio 2015 to compile and link the code.
The full output after compiling mex with -voption is
Verbose mode is on.
... Looking for compiler 'Intel Parallel Studio XE 2017 for Fortran with Microsoft Visual Studio 2015' ...
... Looking for environment variable 'IFORT_COMPILER17' ...Yes ('C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2017.5.267\windows\').
... Looking for file 'C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2017.5.267\windows\Bin\intel64\ifort.exe' ...Yes.
... Looking for folder 'C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2017.5.267\windows' ...Yes.
... Looking for registry setting 'HKLM\SOFTWARE\Microsoft\VisualStudio\SxS\VS7' 14.0 ...No.
... Looking for registry setting 'HKCU\SOFTWARE\Microsoft\VisualStudio\SxS\VS7' 14.0 ...No.
... Looking for registry setting 'HKLM\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\SxS\VS7' 14.0 ...Yes ('C:\Program Files (x86)\Microsoft Visual Studio 14.0\').
... Looking for file 'C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\amd64\cl.exe' ...Yes.
... Looking for folder 'C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC' ...Yes.
... Looking for registry setting 'HKLM\SOFTWARE\Microsoft\Microsoft SDKs\Windows\v8.1' InstallationFolder ...No.
... Looking for registry setting 'HKCU\SOFTWARE\Microsoft\Microsoft SDKs\Windows\v8.1' InstallationFolder ...No.
... Looking for registry setting 'HKLM\SOFTWARE\Wow6432Node\Microsoft\Microsoft SDKs\Windows\v8.1' InstallationFolder ...Yes ('C:\Program Files (x86)\Windows Kits\8.1\').
... Looking for registry setting 'HKLM\SOFTWARE\Microsoft\Windows Kits\Installed Roots' KitsRoot10 ...Yes ('C:\Program Files (x86)\Windows Kits\10\').
Found installed compiler 'Intel Parallel Studio XE 2017 for Fortran with Microsoft Visual Studio 2015'.
Set PATH = C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2017.5.267\windows\bin\intel64;C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\amd64;C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\VCPackages;C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\..\Common7\IDE;C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\..\Common7\Tools;C:\Program Files (x86)\Windows Kits\8.1\\bin\x64;C:\Program Files (x86)\Windows Kits\8.1\\Bin\x86;;C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2017.5.267\windows\mpi\intel64\bin;C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2017.4.210\windows\mpi\intel64\bin;C:\Program Files (x86)\Common Files\Intel\Shared Libraries\redist\intel64_win\mpirt;C:\Program Files (x86)\Common Files\Intel\Shared Libraries\redist\ia32_win\mpirt;C:\Program Files (x86)\Common Files\Intel\Shared Libraries\redist\intel64_win\compiler;C:\Program Files (x86)\Common Files\Intel\Shared Libraries\redist\ia32_win\compiler;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\iCLS\;C:\Program Files\Intel\Intel(R) Management Engine Components\iCLS\;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files\Intel\WiFi;C:\Users\zk1357\AppData\Local\Microsoft\WindowsApps;C:\Users\zk1357\AppData\Roaming\npm;C:\Delft3D\w32\lib;C:\PROGRA~1\Deltares\w32\lib;C:\Program Files\TortoiseSVN\bin;C:\Program Files\MATLAB\MATLAB Compiler Runtime\v82\runtime\win64;"C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Windows\SysWOW64";C:\Program Files\Intel\WiFi\bin\;C:\Program Files\Common Files\Intel\WirelessCommon\;C:\WINDOWS\system32;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;C:\Program Files\Polyspace\R2019b\runtime\win64;C:\Program Files\Polyspace\R2019b\bin;C:\Program Files\Polyspace\R2019b\polyspace\bin;C:\Users\zk1357\AppData\Local\Microsoft\WindowsApps;C:\Users\zk1357\AppData\Roaming\npm;"C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem";C:\Program Files (x86)\IntelSWTools\parallel_studio_xe_2017.5.060\compilers_and_libraries_2017\windows\bin\intel64;C:\Users\zk1357\iRIC\guis\prepost;
Set INCLUDE = C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2017.5.267\windows\include;C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2017.5.267\windows\compiler\include;C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE;C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\ATLMFC\INCLUDE;C:\Program Files (x86)\Windows Kits\10\\include\10.0.10150.0\ucrt;C:\Program Files (x86)\Windows Kits\8.1\\include\shared;C:\Program Files (x86)\Windows Kits\8.1\\include\um;C:\Program Files (x86)\Windows Kits\8.1\\include\winrt;C:\Program Files\Polyspace\R2019b\extern\include;;C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2017.5.267\windows\include;C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2017.5.267\windows\compiler\include;C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE;C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\ATLMFC\INCLUDE;C:\Program Files (x86)\Windows Kits\10\\include\10.0.10150.0\ucrt;C:\Program Files (x86)\Windows Kits\8.1\\include\shared;C:\Program Files (x86)\Windows Kits\8.1\\include\um;C:\Program Files (x86)\Windows Kits\8.1\\include\winrt;C:\Program Files\Polyspace\R2019b\extern\include;;
Set LIB = C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2017.5.267\windows\lib\intel64;C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2017.5.267\windows\compiler\lib\intel64;C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2017.5.267\windows\compiler\lib\intel64_win;C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\Lib\amd64;C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\ATLMFC\Lib\amd64;C:\Program Files (x86)\Windows Kits\10\\Lib\10.0.10150.0\ucrt\x64;C:\Program Files (x86)\Windows Kits\8.1\\lib\winv6.3\um\x64;C:\Program Files\Polyspace\R2019b\lib\win64;C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2017.5.267\windows\lib\intel64;C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2017.5.267\windows\compiler\lib\intel64;C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2017.5.267\windows\compiler\lib\intel64_win;C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\Lib\amd64;C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\ATLMFC\Lib\amd64;C:\Program Files (x86)\Windows Kits\10\\Lib\10.0.10150.0\ucrt\x64;C:\Program Files (x86)\Windows Kits\8.1\\lib\winv6.3\um\x64;C:\Program Files\Polyspace\R2019b\lib\win64;
Set LIBPATH = C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2017.5.267\windows\compiler\Lib\Intel64;C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2017.5.267\windows\compiler\lib\intel64_win;C:\Program Files (x86)\Windows Kits\8.1\\LIB\x64;C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\LIB\amd64;C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\ATLMFC\LIB\amd64;C:\Program Files\Polyspace\R2019b\extern\lib\win64;;C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2017.5.267\windows\compiler\Lib\Intel64;C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2017.5.267\windows\compiler\lib\intel64_win;C:\Program Files (x86)\Windows Kits\8.1\\LIB\x64;C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\LIB\amd64;C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\ATLMFC\LIB\amd64;C:\Program Files\Polyspace\R2019b\extern\lib\win64;;
Options file details
-------------------------------------------------------------------
Compiler location: C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2017.5.267\windows
Options file: C:\Users\zk1357\AppData\Roaming\MathWorks\MATLAB\R2019b\mex_FORTRAN_win64.xml
CMDLINE200 : link /nologo /manifest /INCREMENTAL:NO /DLL /EXPORT:MEXFUNCTION /EXPORT:MEXFILEREQUIREDAPIVERSION C:\Users\zk1357\AppData\Local\Temp\mex_155853875819566_16652\ero_dep_fortran.obj C:\Users\zk1357\AppData\Local\Temp\mex_155853875819566_16652\Module.obj C:\Users\zk1357\AppData\Local\Temp\mex_155853875819566_16652\prepare_bank_collapse.obj C:\Users\zk1357\AppData\Local\Temp\mex_155853875819566_16652\LINEAR_ELASTIC_STIFFNESS.obj C:\Users\zk1357\AppData\Local\Temp\mex_155853875819566_16652\FAILURE_CRITERION.obj C:\Users\zk1357\AppData\Local\Temp\mex_155853875819566_16652\OUTPUT.obj C:\Users\zk1357\AppData\Local\Temp\mex_155853875819566_16652\pardisonew.obj C:\Users\zk1357\AppData\Local\Temp\mex_155853875819566_16652\fortran_mexapi_version.obj "/LIBPATH:C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2017.5.267\windows\mkl\lib\intel64" /LIBPATH:"C:\Program Files\Polyspace\R2019b\extern\lib\win64\microsoft" libmx.lib libmex.lib libmat.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /out:ero_dep_fortran.mexw64
CMDLINE250 : mt -outputresource:ero_dep_fortran.mexw64;2 -manifest "ero_dep_fortran.mexw64.manifest"
CMDLINE300 : del "ero_dep_fortran.exp" "ero_dep_fortran.lib" "ero_dep_fortran.mexw64.manifest" "ero_dep_fortran.ilk"
COMPILER : ifort
COMPFLAGS : /nologo /fpp /Qprec /MD /fp:source /assume:bscc -I"C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2017.5.267\windows\mkl\include" -I"C:\Program Files\Polyspace\R2019b\extern\include" /DMATLAB_DEFAULT_RELEASE=R2017b /DUSE_MEX_CMD /DMATLAB_MEX_FILE -Qopenmp -Qmkl /integer-size:64
COMPDEFINES : /DMATLAB_DEFAULT_RELEASE=R2017b /DUSE_MEX_CMD /DMATLAB_MEX_FILE
OPTIMFLAGS : /O2 /DNDEBUG
INCLUDE : -I"C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2017.5.267\windows\mkl\include" -I"C:\Program Files\Polyspace\R2019b\extern\include"
DEBUGFLAGS : /Z7
LINKER : link
LINKFLAGS : /nologo /manifest /INCREMENTAL:NO
LINKTYPE : /DLL
LINKEXPORT : /EXPORT:MEXFUNCTION
LINKEXPORTVER : /EXPORT:MEXFUNCTION /EXPORT:MEXFILEREQUIREDAPIVERSION
LINKLIBS : "/LIBPATH:C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2017.5.267\windows\mkl\lib\intel64" /LIBPATH:"C:\Program Files\Polyspace\R2019b\extern\lib\win64\microsoft" libmx.lib libmex.lib libmat.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib
LINKDEBUGFLAGS : /debug /PDB:"ero_dep_fortran.mexw64.pdb"
LINKOPTIMFLAGS :
OBJEXT : .obj
LDEXT : .mexw64
SETENV : set COMPILER=ifort
set COMPFLAGS=/c /nologo /fpp /Qprec /MD /fp:source /assume:bscc -I"C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2017.5.267\windows\mkl\include" -I"C:\Program Files\Polyspace\R2019b\extern\include" /DMATLAB_DEFAULT_RELEASE=R2017b /DUSE_MEX_CMD /DMATLAB_MEX_FILE -Qopenmp -Qmkl /integer-size:64 /DMATLAB_DEFAULT_RELEASE=R2017b /DUSE_MEX_CMD /DMATLAB_MEX_FILE $MATLABMEX
set OPTIMFLAGS=/O2 /DNDEBUG
set DEBUGFLAGS=/Z7
set LINKER=link
set LINKFLAGS= /nologo /manifest /INCREMENTAL:NO /export:%ENTRYPOINT% /DLL "/LIBPATH:C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2017.5.267\windows\mkl\lib\intel64" /LIBPATH:"C:\Program Files\Polyspace\R2019b\extern\lib\win64\microsoft" libmx.lib libmex.lib libmat.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /EXPORT:MEXFUNCTION
set LINKDEBUGFLAGS=/debug /PDB:"%OUTDIR%%MEX_NAME%.mexw64.pdb"
set NAME_OUTPUT=/out:"%OUTDIR%%MEX_NAME%%MEX_EXT%"
FORTRANROOT : C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2017.5.267\windows
VCROOT : C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC
SDKROOT : C:\Program Files (x86)\Windows Kits\8.1\
KITSROOT : C:\Program Files (x86)\Windows Kits\10\
MATLABROOT : C:\Program Files\Polyspace\R2019b
ARCH : win64
SRC : "C:\Users\zk1357\Desktop\Evolution_Code_Doubon\ero_dep_fortran.F";"C:\Users\zk1357\Desktop\Evolution_Code_Doubon\Module.F";"C:\Users\zk1357\Desktop\Evolution_Code_Doubon\prepare_bank_collapse.F";"C:\Users\zk1357\Desktop\Evolution_Code_Doubon\LINEAR_ELASTIC_STIFFNESS.F";"C:\Users\zk1357\Desktop\Evolution_Code_Doubon\FAILURE_CRITERION.F";"C:\Users\zk1357\Desktop\Evolution_Code_Doubon\OUTPUT.F";"C:\Users\zk1357\Desktop\Evolution_Code_Doubon\pardisonew.F";"C:\Program Files\Polyspace\R2019b\extern\version\fortran_mexapi_version.F"
OBJ : C:\Users\zk1357\AppData\Local\Temp\mex_155853875819566_16652\ero_dep_fortran.obj;C:\Users\zk1357\AppData\Local\Temp\mex_155853875819566_16652\Module.obj;C:\Users\zk1357\AppData\Local\Temp\mex_155853875819566_16652\prepare_bank_collapse.obj;C:\Users\zk1357\AppData\Local\Temp\mex_155853875819566_16652\LINEAR_ELASTIC_STIFFNESS.obj;C:\Users\zk1357\AppData\Local\Temp\mex_155853875819566_16652\FAILURE_CRITERION.obj;C:\Users\zk1357\AppData\Local\Temp\mex_155853875819566_16652\OUTPUT.obj;C:\Users\zk1357\AppData\Local\Temp\mex_155853875819566_16652\pardisonew.obj;C:\Users\zk1357\AppData\Local\Temp\mex_155853875819566_16652\fortran_mexapi_version.obj
OBJS : C:\Users\zk1357\AppData\Local\Temp\mex_155853875819566_16652\ero_dep_fortran.obj C:\Users\zk1357\AppData\Local\Temp\mex_155853875819566_16652\Module.obj C:\Users\zk1357\AppData\Local\Temp\mex_155853875819566_16652\prepare_bank_collapse.obj C:\Users\zk1357\AppData\Local\Temp\mex_155853875819566_16652\LINEAR_ELASTIC_STIFFNESS.obj C:\Users\zk1357\AppData\Local\Temp\mex_155853875819566_16652\FAILURE_CRITERION.obj C:\Users\zk1357\AppData\Local\Temp\mex_155853875819566_16652\OUTPUT.obj C:\Users\zk1357\AppData\Local\Temp\mex_155853875819566_16652\pardisonew.obj C:\Users\zk1357\AppData\Local\Temp\mex_155853875819566_16652\fortran_mexapi_version.obj
SRCROOT : C:\Users\zk1357\Desktop\Evolution_Code_Doubon\ero_dep_fortran
DEF : C:\Users\zk1357\AppData\Local\Temp\mex_155853875819566_16652\ero_dep_fortran.def
EXP : "ero_dep_fortran.exp"
LIB : "ero_dep_fortran.lib"
EXE : ero_dep_fortran.mexw64
ILK : "ero_dep_fortran.ilk"
MANIFEST : "ero_dep_fortran.mexw64.manifest"
TEMPNAME : ero_dep_fortran
EXEDIR :
EXENAME : ero_dep_fortran
OPTIM : /O2 /DNDEBUG
LINKOPTIM :
CMDLINE100_0 : ifort /c /nologo /fpp /Qprec /MD /fp:source /assume:bscc -I"C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2017.5.267\windows\mkl\include" -I"C:\Program Files\Polyspace\R2019b\extern\include" /DMATLAB_DEFAULT_RELEASE=R2017b /DUSE_MEX_CMD /DMATLAB_MEX_FILE -Qopenmp -Qmkl /integer-size:64 /O2 /DNDEBUG "C:\Users\zk1357\Desktop\Evolution_Code_Doubon\ero_dep_fortran.F" /FoC:\Users\zk1357\AppData\Local\Temp\mex_155853875819566_16652\ero_dep_fortran.obj
CMDLINE100_1 : ifort /c /nologo /fpp /Qprec /MD /fp:source /assume:bscc -I"C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2017.5.267\windows\mkl\include" -I"C:\Program Files\Polyspace\R2019b\extern\include" /DMATLAB_DEFAULT_RELEASE=R2017b /DUSE_MEX_CMD /DMATLAB_MEX_FILE -Qopenmp -Qmkl /integer-size:64 /O2 /DNDEBUG "C:\Users\zk1357\Desktop\Evolution_Code_Doubon\Module.F" /FoC:\Users\zk1357\AppData\Local\Temp\mex_155853875819566_16652\Module.obj
CMDLINE100_2 : ifort /c /nologo /fpp /Qprec /MD /fp:source /assume:bscc -I"C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2017.5.267\windows\mkl\include" -I"C:\Program Files\Polyspace\R2019b\extern\include" /DMATLAB_DEFAULT_RELEASE=R2017b /DUSE_MEX_CMD /DMATLAB_MEX_FILE -Qopenmp -Qmkl /integer-size:64 /O2 /DNDEBUG "C:\Users\zk1357\Desktop\Evolution_Code_Doubon\prepare_bank_collapse.F" /FoC:\Users\zk1357\AppData\Local\Temp\mex_155853875819566_16652\prepare_bank_collapse.obj
CMDLINE100_3 : ifort /c /nologo /fpp /Qprec /MD /fp:source /assume:bscc -I"C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2017.5.267\windows\mkl\include" -I"C:\Program Files\Polyspace\R2019b\extern\include" /DMATLAB_DEFAULT_RELEASE=R2017b /DUSE_MEX_CMD /DMATLAB_MEX_FILE -Qopenmp -Qmkl /integer-size:64 /O2 /DNDEBUG "C:\Users\zk1357\Desktop\Evolution_Code_Doubon\LINEAR_ELASTIC_STIFFNESS.F" /FoC:\Users\zk1357\AppData\Local\Temp\mex_155853875819566_16652\LINEAR_ELASTIC_STIFFNESS.obj
CMDLINE100_4 : ifort /c /nologo /fpp /Qprec /MD /fp:source /assume:bscc -I"C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2017.5.267\windows\mkl\include" -I"C:\Program Files\Polyspace\R2019b\extern\include" /DMATLAB_DEFAULT_RELEASE=R2017b /DUSE_MEX_CMD /DMATLAB_MEX_FILE -Qopenmp -Qmkl /integer-size:64 /O2 /DNDEBUG "C:\Users\zk1357\Desktop\Evolution_Code_Doubon\FAILURE_CRITERION.F" /FoC:\Users\zk1357\AppData\Local\Temp\mex_155853875819566_16652\FAILURE_CRITERION.obj
CMDLINE100_5 : ifort /c /nologo /fpp /Qprec /MD /fp:source /assume:bscc -I"C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2017.5.267\windows\mkl\include" -I"C:\Program Files\Polyspace\R2019b\extern\include" /DMATLAB_DEFAULT_RELEASE=R2017b /DUSE_MEX_CMD /DMATLAB_MEX_FILE -Qopenmp -Qmkl /integer-size:64 /O2 /DNDEBUG "C:\Users\zk1357\Desktop\Evolution_Code_Doubon\OUTPUT.F" /FoC:\Users\zk1357\AppData\Local\Temp\mex_155853875819566_16652\OUTPUT.obj
CMDLINE100_6 : ifort /c /nologo /fpp /Qprec /MD /fp:source /assume:bscc -I"C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2017.5.267\windows\mkl\include" -I"C:\Program Files\Polyspace\R2019b\extern\include" /DMATLAB_DEFAULT_RELEASE=R2017b /DUSE_MEX_CMD /DMATLAB_MEX_FILE -Qopenmp -Qmkl /integer-size:64 /O2 /DNDEBUG "C:\Users\zk1357\Desktop\Evolution_Code_Doubon\pardisonew.F" /FoC:\Users\zk1357\AppData\Local\Temp\mex_155853875819566_16652\pardisonew.obj
CMDLINE100_7 : ifort /c /nologo /fpp /Qprec /MD /fp:source /assume:bscc -I"C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2017.5.267\windows\mkl\include" -I"C:\Program Files\Polyspace\R2019b\extern\include" /DMATLAB_DEFAULT_RELEASE=R2017b /DUSE_MEX_CMD /DMATLAB_MEX_FILE -Qopenmp -Qmkl /integer-size:64 /O2 /DNDEBUG "C:\Program Files\Polyspace\R2019b\extern\version\fortran_mexapi_version.F" /FoC:\Users\zk1357\AppData\Local\Temp\mex_155853875819566_16652\fortran_mexapi_version.obj
-------------------------------------------------------------------
Building with 'Intel Parallel Studio XE 2017 for Fortran with Microsoft Visual Studio 2015'.
ifort /c /nologo /fpp /Qprec /MD /fp:source /assume:bscc -I"C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2017.5.267\windows\mkl\include" -I"C:\Program Files\Polyspace\R2019b\extern\include" /DMATLAB_DEFAULT_RELEASE=R2017b /DUSE_MEX_CMD /DMATLAB_MEX_FILE -Qopenmp -Qmkl /integer-size:64 /O2 /DNDEBUG "C:\Users\zk1357\Desktop\Evolution_Code_Doubon\ero_dep_fortran.F" /FoC:\Users\zk1357\AppData\Local\Temp\mex_155853875819566_16652\ero_dep_fortran.obj
ifort /c /nologo /fpp /Qprec /MD /fp:source /assume:bscc -I"C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2017.5.267\windows\mkl\include" -I"C:\Program Files\Polyspace\R2019b\extern\include" /DMATLAB_DEFAULT_RELEASE=R2017b /DUSE_MEX_CMD /DMATLAB_MEX_FILE -Qopenmp -Qmkl /integer-size:64 /O2 /DNDEBUG "C:\Users\zk1357\Desktop\Evolution_Code_Doubon\Module.F" /FoC:\Users\zk1357\AppData\Local\Temp\mex_155853875819566_16652\Module.obj
ifort /c /nologo /fpp /Qprec /MD /fp:source /assume:bscc -I"C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2017.5.267\windows\mkl\include" -I"C:\Program Files\Polyspace\R2019b\extern\include" /DMATLAB_DEFAULT_RELEASE=R2017b /DUSE_MEX_CMD /DMATLAB_MEX_FILE -Qopenmp -Qmkl /integer-size:64 /O2 /DNDEBUG "C:\Users\zk1357\Desktop\Evolution_Code_Doubon\prepare_bank_collapse.F" /FoC:\Users\zk1357\AppData\Local\Temp\mex_155853875819566_16652\prepare_bank_collapse.obj
ifort /c /nologo /fpp /Qprec /MD /fp:source /assume:bscc -I"C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2017.5.267\windows\mkl\include" -I"C:\Program Files\Polyspace\R2019b\extern\include" /DMATLAB_DEFAULT_RELEASE=R2017b /DUSE_MEX_CMD /DMATLAB_MEX_FILE -Qopenmp -Qmkl /integer-size:64 /O2 /DNDEBUG "C:\Users\zk1357\Desktop\Evolution_Code_Doubon\LINEAR_ELASTIC_STIFFNESS.F" /FoC:\Users\zk1357\AppData\Local\Temp\mex_155853875819566_16652\LINEAR_ELASTIC_STIFFNESS.obj
ifort /c /nologo /fpp /Qprec /MD /fp:source /assume:bscc -I"C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2017.5.267\windows\mkl\include" -I"C:\Program Files\Polyspace\R2019b\extern\include" /DMATLAB_DEFAULT_RELEASE=R2017b /DUSE_MEX_CMD /DMATLAB_MEX_FILE -Qopenmp -Qmkl /integer-size:64 /O2 /DNDEBUG "C:\Users\zk1357\Desktop\Evolution_Code_Doubon\FAILURE_CRITERION.F" /FoC:\Users\zk1357\AppData\Local\Temp\mex_155853875819566_16652\FAILURE_CRITERION.obj
ifort /c /nologo /fpp /Qprec /MD /fp:source /assume:bscc -I"C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2017.5.267\windows\mkl\include" -I"C:\Program Files\Polyspace\R2019b\extern\include" /DMATLAB_DEFAULT_RELEASE=R2017b /DUSE_MEX_CMD /DMATLAB_MEX_FILE -Qopenmp -Qmkl /integer-size:64 /O2 /DNDEBUG "C:\Users\zk1357\Desktop\Evolution_Code_Doubon\OUTPUT.F" /FoC:\Users\zk1357\AppData\Local\Temp\mex_155853875819566_16652\OUTPUT.obj
ifort /c /nologo /fpp /Qprec /MD /fp:source /assume:bscc -I"C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2017.5.267\windows\mkl\include" -I"C:\Program Files\Polyspace\R2019b\extern\include" /DMATLAB_DEFAULT_RELEASE=R2017b /DUSE_MEX_CMD /DMATLAB_MEX_FILE -Qopenmp -Qmkl /integer-size:64 /O2 /DNDEBUG "C:\Users\zk1357\Desktop\Evolution_Code_Doubon\pardisonew.F" /FoC:\Users\zk1357\AppData\Local\Temp\mex_155853875819566_16652\pardisonew.obj
ifort /c /nologo /fpp /Qprec /MD /fp:source /assume:bscc -I"C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2017.5.267\windows\mkl\include" -I"C:\Program Files\Polyspace\R2019b\extern\include" /DMATLAB_DEFAULT_RELEASE=R2017b /DUSE_MEX_CMD /DMATLAB_MEX_FILE -Qopenmp -Qmkl /integer-size:64 /O2 /DNDEBUG "C:\Program Files\Polyspace\R2019b\extern\version\fortran_mexapi_version.F" /FoC:\Users\zk1357\AppData\Local\Temp\mex_155853875819566_16652\fortran_mexapi_version.obj
link /nologo /manifest /INCREMENTAL:NO /DLL /EXPORT:MEXFUNCTION /EXPORT:MEXFILEREQUIREDAPIVERSION C:\Users\zk1357\AppData\Local\Temp\mex_155853875819566_16652\ero_dep_fortran.obj C:\Users\zk1357\AppData\Local\Temp\mex_155853875819566_16652\Module.obj C:\Users\zk1357\AppData\Local\Temp\mex_155853875819566_16652\prepare_bank_collapse.obj C:\Users\zk1357\AppData\Local\Temp\mex_155853875819566_16652\LINEAR_ELASTIC_STIFFNESS.obj C:\Users\zk1357\AppData\Local\Temp\mex_155853875819566_16652\FAILURE_CRITERION.obj C:\Users\zk1357\AppData\Local\Temp\mex_155853875819566_16652\OUTPUT.obj C:\Users\zk1357\AppData\Local\Temp\mex_155853875819566_16652\pardisonew.obj C:\Users\zk1357\AppData\Local\Temp\mex_155853875819566_16652\fortran_mexapi_version.obj "/LIBPATH:C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2017.5.267\windows\mkl\lib\intel64" /LIBPATH:"C:\Program Files\Polyspace\R2019b\extern\lib\win64\microsoft" libmx.lib libmex.lib libmat.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /out:ero_dep_fortran.mexw64
Creating ero_dep_fortran.lib and ero_dep_fortran.exp
mt -outputresource:ero_dep_fortran.mexw64;2 -manifest "ero_dep_fortran.mexw64.manifest"
Microsoft (R) Manifest Tool version 6.3.9600.17336
Copyright (c) Microsoft Corporation 2012.
All rights reserved.
del "ero_dep_fortran.exp" "ero_dep_fortran.lib" "ero_dep_fortran.mexw64.manifest" "ero_dep_fortran.ilk"
MEX completed successfully.
The most probable reason is the incompatibility between the default integer size and MKL library interface version.
LP64 requires 4-byte integers, ILP64 requires 8-byte ones. mex by default adds the /integer-size:64 option, thus making integers 8-byte long. But according to the documentation, with /Qmkl option the compiler links against LP64 libraries.
To fix the problem you need to link against ILP64 libraries explicitly. To that aim remove /Qopenmp /Qmkl and use -lmkl_intel_ilp64.lib -lmkl_intel_thread.lib -lmkl_core.lib libiomp5md.lib link options.
I am pretty new to Visual Studio.. Couldn't find similar topic so starting the new one.
I'm developig an MFC app and I'd like to use mySQL database engine.
I believe I have followed instructions from the official site to install the C++ connector:
Building Connector/C++ Applications: General Considerations and
Building Connector/C++ Applications on Windows with Microsoft Visual Studio
i.e:
I downloaded c++ connector (together with mySQL database engine)
I chose to link dynamically against precompiled (by Oracle) c++ connector
which means I need : LIB/vs14/mysqlcppconn8.lib (import library), LIB/mysqlcppconn8-1-vs14.dll
I selected debug mode in my configuration (according to the official docs I can do it even though the library itself may be compiled in release mode)
I added Additional Include Directories (Compiler->General) - which in my case is: "C:\Program Files\MySQL\Connector C++ 8.0\include" - this is where mysqlx/xdevapi.h resides
I added Additional Library Directories (Linker->General) - which in my case is: "C:\Program Files\MySQL\Connector C++ 8.0\lib64"
I added Additional Dependencies (Linker->Input) which in my case is mysqlcppconn8.lib (static import lib for the dll)
I changed option for Runtime Library (C++ -> Code Generation) from MDd to MT (as suggested in the documentation)
I extended the PATH env variable by adding the directory where the actual dll library is located (in my case the location of the file is C:\Program Files\MySQL\Connector C++ 8.0\lib64\mysqlcppconn8-1-vs14.dll so the path is C:\Program Files\MySQL\Connector C++ 8.0\lib64)
In the wizard-generated MFC project I added #include and I get following error: fatal error C1083: Cannot open include file: 'mysqlx/xdevapi.h': No such file or directory
I'm wondering what is causing this since I have added Include search path in step 4.
The directory structure for the library is as follows:
C:\Program Files\MySQL\Connector C++ 8.0\include\mysqlx\xdevapi.h
C:\Program Files\MySQL\Connector C++ 8.0\lib64\mysqlcppconn8-1-vs14.dll
C:\Program Files\MySQL\Connector C++ 8.0\lib64\vs14\mysqlcppconn8.lib
The complier command:
/Yu"stdafx.h" /GS /analyze- /W3 /Zc:wchar_t /I"C:\Program
Files\MySQL\Connector C++ 8.0\include\mysqlx" /I"C:\Program
Files\MySQL\Connector C++ 8.0\include" /ZI /Gm /Od /sdl
/Fd"Debug\vc141.pdb" /Zc:inline /fp:precise /D "WIN32" /D "_WINDOWS" /D
"_DEBUG" /D "_UNICODE" /D "UNICODE" /D "_AFXDLL" /errorReport:prompt /WX-
/Zc:forScope /RTC1 /Gd /Oy- /MT /Fa"Debug\" /EHsc /nologo /Fo"Debug\"
/Fp"Debug\exam-questions.pch" /diagnostics:classic
The linker command:
/OUT:"C:\Users\Kamilek\source\repos\exam-questions\Debug\exam-
questions.exe" /MANIFEST /NXCOMPAT
/PDB:"C:\Users\Kamilek\source\repos\exam-questions\Debug\exam-
questions.pdb" /DYNAMICBASE "mysqlcppconn8.lib" /DEBUG:FASTLINK
/MACHINE:X86 /INCREMENTAL /PGD:"C:\Users\Kamilek\source\repos\exam-
questions\Debug\exam-questions.pgd" /SUBSYSTEM:WINDOWS
/MANIFESTUAC:"level='asInvoker' uiAccess='false'"
/ManifestFile:"Debug\exam-questions.exe.intermediate.manifest"
/ERRORREPORT:PROMPT /NOLOGO /LIBPATH:"C:\Program Files\MySQL\Connector
C++ 8.0\lib64\" /TLBID:1
I just upgraded to MSVC 2012 Express (which is saying trial btw. I wonder why as it should be free). After lots of changes from MSVC 2005 it started working, but the linker hangs, but only in debug mode x64, in all other 3 modes it works! Here are the commandline arguments (I called it from a script, but it does the same thing when called from IDE).
cl.exe /fp:precise /Od /MTd /bigobj /RTCscu /Zi /GS- /TP /Fd"!temp/DebugDebug1/MRotary/vc70.pdb" /D_USRDLL /D_WINDLL /D_WINDOWS
/DWIN64 /Fo"!temp/DebugDebug1/MRotary/main.obj"
/FR"!temp/DebugDebug1/MRotary/" /I "C:/Program Files (x86)/Microsoft
Visual Studio 11.0/Vc/include" /I "C:/Program Files (x86)/Windows
Kits/8.0/Include/um" /I "C:/Program Files (x86)/Windows
Kits/8.0/Include/shared" /I "C:/Program Files
(x86)/Intel/IPP/6.1.2.041/em64t/include" /D_MBCS /c /W3 /EHsc /GF /Gd
/Zc:wchar_t /Zc:forScope /nologo MDrummer/VSTEffects/main.cpp
link.exe !temp/DebugDebug1/MRotary/icon.res !temp/DebugDebug1/MRotary/main.obj
!temp/DebugDebug1/MRotary/resourcesrotary.obj
!temp/DebugDebug1/MRotary/mlibrary.obj mlibraryasm_x64_debug.lib
kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib
advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib
odbccp32.lib comctl32.lib wsock32.lib winmm.lib msimg32.lib psapi.lib
opengl32.lib Glu32.lib freetype_x64_debug.lib zlib_x64_debug.lib
libpng_x64_debug.lib libtiff_x64_debug.lib libjpeg_x64_debug.lib
giflib_x64_debug.lib bzip2_x64_debug.lib libflac_x64_debug.lib
vstsdk3_x64_debug.lib ippcoreem64tl.lib ippsemergedem64t.lib
ippsmergedem64t.lib ippiemergedem64t.lib ippimergedem64t.lib
ippvmemergedem64t.lib ippvmmergedem64t.lib /OUT:"c:/program
files/vstplugins/MeldaProductionx64/Modulation/MRotary.dll"
/INCREMENTAL:NO /DEBUG /MACHINE:X64 /SUBSYSTEM:WINDOWS
/DEF:"D:/Programming/Mlibrary/mvstplugin.def" /DLL
/IMPLIB:"D:/Programming/MDrummer/!temp/DebugDebug1/MRotary.lib"
/PDB:"c:/program
files/vstplugins/MeldaProductionx64/Modulation/MRotary.pdb"
/LIBPATH:"D:/Programming/Mlibrary/library"
/LIBPATH:"D:/Programming/MDrummer"
/LIBPATH:"D:/Programming/MDrummer/!temp/DebugDebug1"
/LIBPATH:"D:/Programming/MDrummer/c:\program
files\vstplugins\MeldaProductionx64" /LIBPATH:"C:/Program Files
(x86)/Microsoft Visual Studio 11.0/Vc/lib/amd64" /LIBPATH:"C:/Program
Files (x86)/Windows Kits/8.0/Lib/win8/um/x64" /LIBPATH:"C:/Program
Files (x86)/Intel/IPP/6.1.2.041/em64t/lib" /LIBPATH:"C:/Program Files
(x86)/Intel/IPP/6.1.2.041/em64t/stublib" /OPT:REF /OPT:ICF /nologo
/MANIFEST:NO
Any ideas? I searched there have been troubles with this, but nothing seems related to this specific one.
Ok so apparently it starts working if I remove "/OPT:REF /OPT:ICF", but why and why only in such specific circumstances, that's a question...
I am using Visual Studio 2010 to create a small c++ executable. Since I now want to use a different editor I have to call cl.exe and link.exe from the command line.
It is great that VS provides the used command-lines in Project->Properties->C/C++->Commandline and ->Linker->CommandLine
however, they dont work quite like they should:
In the compiler command line I added /c and removed the file-renaming-stuff /Fp /Fa /Fo /Fd (http://msdn.microsoft.com/en-us/library/fwkeyyhe.aspx)
In the linker command line I removed the /MANIFEST and /Manifest
(http://msdn.microsoft.com/en-us/library/y0zzbyt4.aspx)
the result is this:
cl.exe main.cpp /c /Zi /nologo /W3 /WX-
/O1 /Oi /Os /Oy /GL
/D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_UNICODE" /D "UNICODE"
/Gm- /EHsc /GS /Gy /fp:precise
/Zc:wchar_t /Zc:forScope /Gd /analyze- /errorReport:queue
link.exe *.obj /OUT:"test2.exe" /INCREMENTAL:NO /NOLOGO
"kernel32.lib" "user32.lib" "gdi32.lib" "winspool.lib"
"comdlg32.lib" "advapi32.lib" "shell32.lib" "ole32.lib"
"oleaut32.lib" "uuid.lib" "odbc32.lib" "odbccp32.lib"
/ALLOWISOLATION /MANIFESTUAC:"level='asInvoker' uiAccess='false'"
/DEBUG /PDB:"F:\prj\visualstudio2010\test2\Release\test2.pdb"
/SUBSYSTEM:CONSOLE /OPT:REF /OPT:ICF
/PGD:"F:\prj\visualstudio2010\test2\Release\test2.pgd"
/LTCG /TLBID:1 /DYNAMICBASE /NXCOMPAT /MACHINE:X86 /ERRORREPORT:QUEUE
The resulting exe works the same way as if i had built it using the GUI, but the problem is that it is 145kb instead of 22kb for some reason. Should I just accept that or is there something obvious that the GUI has and that I am missing?
As an alternative to manually reproducing the individual command line args you can use msbuild.exe to build an entire solution from the command line:
On my machine the command would look like the following:
"c:\Windows\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe" /t:Build /verbosity:minimal /maxcpucount /p:Configuration=Debug;Platform="x64" "C:\path\to\some_sln.sln"
Full documentation on msbuild can be found here.
I would try running that and see if you're getting the exe size you expect.
You can see full build log, including command line switches, in the project output directory, program_name.log file. You can also build the project from command line: http://msdn.microsoft.com/en-us/library/vstudio/xee0c8y7.aspx
Actually, it's something the original poster apparently figured out on their own but a critical part of running Visual Studio tools from the command line is to run the following batch file to set your environment variables correctly. Otherwise, you will get an error about missing DLLs, and so on. (This is Visual Studio 2008, Windows 7, but other combinations may be quite similar.)
C:\Program Files\Microsoft Visual Studio 9.0\VC\bin\vcvars32.bat
which simply runs:
C:\Program Files\Microsoft Visual Studio 9.0\Common7\Tools\vsvars32.bat
You can compile a C++ project from a command line or .bat file. This works for VS2019:
rem path to Visual studio. No quotation marks:
set vspath=C:\Program Files (x86)\Microsoft Visual Studio\2019\Community
rem path to vcvars files
set batpath=%vspath%\VC\Auxiliary\Build
rem set system path
path %batpath%;%path%
rem set all paths and include directories for 64-bit mode compilation
call vcvars64.bat x64
rem compile:
cl [options] test.cpp /Fetest.exe
rem pause to see if compilation succeeds
pause
rem run the compiled program
test.exe
pause