VS 2010 express compiler Matlab shared libraries
조회 수: 5 (최근 30일)
이전 댓글 표시
Hello, I'm following this tutorial <http://www.mathworks.com/support/solutions/en/data/1-F9VB0V/index.html?product=CO&solution=1-F9VB0V> , but after all dependencies been satisfied I get this error:
fatal error LNK1181: cannot open input file 'kernel32.lib'
Any Ideas?
댓글 수: 4
Mark Mikofski
2012년 8월 28일
편집: Mark Mikofski
2012년 8월 29일
- kernel32.lib on x64 is not necessarily an x86 library. Search for it and you will find it in both "Program Files (x86)" and "Program Files". On MS-Windows, "32" is a legacy suffix. For example "system32" is the x64 folder and "sysWOW64" is actually the x86 folder, which literally means "system32 Windows on Windows x64"
- See WoW64 on Wikipedia
- also use ...
mexConf = mex.getCompilerConfigurations
mexConf.Details.LinkerFlags
... and you will see kernel32.lib linked.
- see Get compiler configuration
- Evidently VS10 Express is no longer supported as of MATALB 2012a, even though it was in MATLAB 2011b and before!
- See MATLAB 2012a win64 compatible compilers
- See MATLAB 2011b win64 compatible compilers
- See MATLAB 2012a win32 compatible compilers
- See MATLAB 2011b win32 compatible compilers
- Fortuitously VS10 Express still works for 32-bit MATLAB 2012a; I just used it, although it does not pop up as an option when you try ...
mex -setup
... presumably because it is not officially supported anymore. The "professional" versions are supported, as is Windows SDK 7.1.
Mark Mikofski
2012년 8월 28일
One more note:
I just compiled a file with the Windows 7.1 SDK compiler and compared it with the original compiled with VS10 Express, and the files are identical byte for byte. This is not super surprising because previously VS10 Express only worked on x64 with the Windows 7.1 SDK, and MATLAB seems to state that Windows 7.1 SDK is inside of VS10 Express, so maybe they are nearly one and the same now? I'm going to think of this as an improvement.
답변 (1개)
Mark Mikofski
2012년 8월 29일
편집: Mark Mikofski
2012년 8월 29일
From your link it appears that you are using MATLAB 2011a on Windows 7 x64. If this is not true please respond with your version of MATLAB. Nevertheless I will address issues for both prior to 2012a and post and for both x86 and x64.
- Your problem may be related to Microsoft KB 2519277, if you had previously installed Microsoft Visual C++ 2010 Express (VS 2010 Express) and Windows SDK 7.1, and then later applied the Service Pack 1 Compiler Update. The solution is to download and install this update: VC-Compiler-KB2519277.exe.
- You may not have Windows SDK 7.1 installed at all. According to this list of supported compilers for MATLAB 2011a (x64), MATLAB 2011a only supports VS 2010 Express if it used with Windows SDK 7.1. Here is a nice step-by-step solution posted by MathWorks. Note: You may still need to install the Visual C++ SP1 Compiler Update for Windows SDK 7.1. See the link to KB 2519277 above.
- If you have MATLAB 2012a or later, then the problem is that VS 2010 Express is not supported in MATLAB 2012a or later, although Microsoft Visual C++ 2010 Professional is still supported, and Windows SDK 7.1 is now supported by itself. See the list of supported compilers for MATLAB 2012a (x64). You do not need VS 2010 Express.
- Windows x86 versions of MATLAB 2011b and earlier do not require Windows SDK 7.1, that is they work with VS 2010 Express. However Windows x86 versions of MATLAB 2012a and later only use Windows SDK 7.1, similar to the x64 versions, and do not require VS 2010 express. Unfortunately there is an issue installing Windows SDK 7.1 when VS 2010 SP1 has already been installed which is also described in KB 2519277 (see above). The preferred method of installation is (1) Visual C++ 2010 (Express or Professional), (2) Windows SDK 7.1, (3) Visual C++ 2010 SP1, (4) the Visual C++ SP1 Compiler Update for Windows SDK 7.1. If you try to install Windows SDK 7.1 after installing SP1, then you will get a "fatal error" when it attempts to install the C++ compilers. Ugh! The workaround is to uncheck the "C++ compilers" box and rerun the installation. Then after the installation is complete run the Visual C++ SP1 Compiler Update for Windows SDK 7.1.
Please consult the appropriate list of supported compilers for all x86 versions of MATLAB. However
댓글 수: 1
Mark Mikofski
2012년 8월 29일
Also note: You are not required to install the Visual C++ 2010 SP1 update.
참고 항목
카테고리
Help Center 및 File Exchange에서 C Shared Library Integration에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!