LNK1181: cannot open input file "kernel32.lib"

조회 수: 33 (최근 30일)
Ajith
Ajith 2013년 2월 5일
답변: Jérôme Unknown 2016년 3월 10일
When I am building the SFunction I am building with Microsoft Visual C++ 6.0 I am getting S function builder LINK : fatal error LNK1181: cannot open input file "kernel32.lib". When I checked the path C:\Program Files\Microsoft Visual Studio\VC98\Lib I found "kernel32.lib" Can any one suggest me how to resolve this error.Any additional setting I have to do?
Regards Ajith
  댓글 수: 1
Ajith
Ajith 2013년 2월 5일
Hi anyone know what settings we have to do for this?

댓글을 달려면 로그인하십시오.

답변 (3개)

Renish Ramegowda
Renish Ramegowda 2013년 4월 18일
편집: Walter Roberson 2015년 5월 23일
Hi Ajith,
Please follow the below steps and you can resolve the issue.
When you run >> mex -setup command on your command window, file mexopts.bat placed in the path "C:\Documents and Settings\users\Application Data\MathWorks\MATLAB\R2011a" gets updated.
If you open this file with wordpad, you can observe the below instruction under the section "General Parameters" set VSINSTALLDIR=C:\Program Files\Microsoft Visual Studio\VC98\
Just modify the instruction as shown below and save the file
set VSINSTALLDIR=C:\Program Files\Microsoft Visual Studio\
Now try to build the SFunction. The error will be resolved. This is a temporary solution. Next time you run the >> mex -setup command, the error reappears :)
Now you can repeat the above steps once again to get rid of the issue
  댓글 수: 1
Shuhang Zhai
Shuhang Zhai 2015년 5월 23일
I'm having the same issue running R2012b on Windows 7 with the Windows 7 SDK.
The line in mexopts.bat is: set VSINSTALLDIR=C:\Program Files (x86)\Microsoft Visual Studio 10.0
There doesn't seem to be anything obvious to change it to. I've looked around online and haven't found anything useful. Any suggestions?

댓글을 달려면 로그인하십시오.


Cliff
Cliff 2014년 2월 10일
I'm having the same issue running R2013b on Windows 7 with the Windows 7 SDK.
The line in mexopts.bat is: set VSINSTALLDIR=C:\Program Files (x86)\Microsoft Visual Studio 10.0
There doesn't seem to be anything obvious to change it to. I've looked around online and haven't found anything useful. Any suggestions?
  댓글 수: 2
Shuhang Zhai
Shuhang Zhai 2015년 5월 23일
Yes I am facing exactly the same issue now. And I have struggled for several days. How did you solve it?
Joshua Winebarger
Joshua Winebarger 2015년 8월 25일
I have this same problem as well. Is there no one who can answer this?

댓글을 달려면 로그인하십시오.


Jérôme Unknown
Jérôme Unknown 2016년 3월 10일
If you're having this issue LNK1181: cannot open input file "kernel32.lib" with mex with any other lib, you might need to clean up your current configuration file: C:\Documents and Settings\users\Application Data\MathWorks\MATLAB\R2013a (i.e. create a backup and then delete this file) and re-execute:
mex -setup
in Matlab to get a clean configuration.
If resetting your config and selecting the other compilers available on your computer, you might also consider upgrading to a newer Visual Studio also or Windows SDK (also including a compiler), there are incompatibilities with older versions and reexecuting this mex -setup to select your fresh compiler.

카테고리

Help CenterFile Exchange에서 Introduction to Installation and Licensing에 대해 자세히 알아보기

태그

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by