MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

# Thread Subject: Compile error with Fortran 11.1 and R2009b

 Subject: Compile error with Fortran 11.1 and R2009b From: DJ Date: 14 Oct, 2009 15:47:01 Message: 1 of 6 Hello, I'm trying to create a mex file on a .f90 file which compiles in Fortran using Microsoft Visual Studios 2008. I keep receiving the error: LINK : fatal error LNK1104: cannot open file 'kernel32.lib' I've tried using -Ipathname, -lname, and -Ldirectory to specify where Kernel32.Lib is, but that doesn't seem to work either. Here are the steps I've taken: mex -setup Please choose your compiler for building external interface (MEX) files:   Would you like mex to locate installed compilers [y]/n? y   Select a compiler: [1] Intel Visual Fortran 11.1 (with Microsoft Visual C++ 2008 SP1 linker) in C:\Users\DJ Ferris\Desktop\Compiler\11.1\048\ [2] Lcc-win32 C 2.4.1 in C:\PROGRA~1\MATLAB\R2009b\sys\lcc [3] Microsoft Visual C++ 2008 SP1 in C:\Program Files\Microsoft Visual Studio 9.0   [0] None   Compiler: 1   Please verify your choices:   Compiler: Intel Visual Fortran 11.1 Location: C:\Users\DJ Ferris\Desktop\Compiler\11.1\048\   Are these correct [y]/n? y   Trying to update options file: C:\Users\DJ Ferris\AppData\Roaming\MathWorks\MATLAB\R2009b\mexopts.bat From template: C:\PROGRA~1\MATLAB\R2009b\bin\win32\mexopts\intelf11msvs2008opts.bat mex 'C:\Users\DJ Ferris\Documents\Visual Studio 2008\Projects\Console2\Console2\Console2.f90' LINK : fatal error LNK1104: cannot open file 'kernel32.lib'     C:\PROGRA~1\MATLAB\R2009B\BIN\MEX.PL: Error: Link of 'Console2.mexw32' failed.   ??? Error using ==> mex at 221 Unable to complete successfully. mex -Ldirectory 'C:\Program Files\Microsoft SDKs\Windows\v6.0A\Lib' LINK : fatal error LNK1181: cannot open input file 'C:\PROGRA~1\MI2578~1\WINDOWS\V6.0A\Lib.obj'     C:\PROGRA~1\MATLAB\R2009B\BIN\MEX.PL: Error: Link of '.mexw32' failed.   ??? Error using ==> mex at 221 Unable to complete successfully.   >> mex -lname 'C:\Program Files\Microsoft SDKs\Windows\v6.0A\Lib\Kernel32.Lib'   Warning: MEX could not find the library "name"          specified with -l option on the path specified          with the -L option. LINK : warning LNK4001: no object files specified; libraries used LINK : warning LNK4068: /MACHINE not specified; defaulting to X86 LINK : error LNK2001: unresolved external symbol MEXFUNCTION C:\USERS\DJFERR~1\APPDATA\LOCAL\TEMP\MEX_DJ~1\templib.x : fatal error LNK1120: 1 unresolved externals     C:\PROGRA~1\MATLAB\R2009B\BIN\MEX.PL: Error: Link of 'Kernel32.mexw32' failed.   ??? Error using ==> mex at 221 Unable to complete successfully. Thanks for your help. DJ Ferris
 Subject: Compile error with Fortran 11.1 and R2009b From: chris Date: 25 Oct, 2009 07:22:19 Message: 2 of 6 Hi, Check this thread: http://software.intel.com/en-us/forums/intel-visual-fortran-compiler-for-windows/topic/60737/ - it may be an issue with your installation of Visual Studio 2008. HTH "DJ " wrote in message ... > Hello, > > I'm trying to create a mex file on a .f90 file which compiles in Fortran using Microsoft Visual Studios 2008. I keep receiving the error: > > LINK : fatal error LNK1104: cannot open file 'kernel32.lib' > > I've tried using -Ipathname, -lname, and -Ldirectory to specify where Kernel32.Lib is, but that doesn't seem to work either. Here are the steps I've taken: > > mex -setup > Please choose your compiler for building external interface (MEX) files: > > Would you like mex to locate installed compilers [y]/n? y > > Select a compiler: > [1] Intel Visual Fortran 11.1 (with Microsoft Visual C++ 2008 SP1 linker) in C:\Users\DJ Ferris\Desktop\Compiler\11.1\048\ > [2] Lcc-win32 C 2.4.1 in C:\PROGRA~1\MATLAB\R2009b\sys\lcc > [3] Microsoft Visual C++ 2008 SP1 in C:\Program Files\Microsoft Visual Studio 9.0 > > [0] None > > Compiler: 1 > > Please verify your choices: > > Compiler: Intel Visual Fortran 11.1 > Location: C:\Users\DJ Ferris\Desktop\Compiler\11.1\048\ > > Are these correct [y]/n? y > > Trying to update options file: C:\Users\DJ Ferris\AppData\Roaming\MathWorks\MATLAB\R2009b\mexopts.bat > From template: C:\PROGRA~1\MATLAB\R2009b\bin\win32\mexopts\intelf11msvs2008opts.bat > > mex 'C:\Users\DJ Ferris\Documents\Visual Studio 2008\Projects\Console2\Console2\Console2.f90' > LINK : fatal error LNK1104: cannot open file 'kernel32.lib' > > C:\PROGRA~1\MATLAB\R2009B\BIN\MEX.PL: Error: Link of 'Console2.mexw32' failed. > > ??? Error using ==> mex at 221 > Unable to complete successfully. > > mex -Ldirectory 'C:\Program Files\Microsoft SDKs\Windows\v6.0A\Lib' > LINK : fatal error LNK1181: cannot open input file 'C:\PROGRA~1\MI2578~1\WINDOWS\V6.0A\Lib.obj' > > C:\PROGRA~1\MATLAB\R2009B\BIN\MEX.PL: Error: Link of '.mexw32' failed. > > ??? Error using ==> mex at 221 > Unable to complete successfully. > > >> mex -lname 'C:\Program Files\Microsoft SDKs\Windows\v6.0A\Lib\Kernel32.Lib' > > Warning: MEX could not find the library "name" > specified with -l option on the path specified > with the -L option. > LINK : warning LNK4001: no object files specified; libraries used > LINK : warning LNK4068: /MACHINE not specified; defaulting to X86 > LINK : error LNK2001: unresolved external symbol MEXFUNCTION > C:\USERS\DJFERR~1\APPDATA\LOCAL\TEMP\MEX_DJ~1\templib.x : fatal error LNK1120: 1 unresolved externals > > C:\PROGRA~1\MATLAB\R2009B\BIN\MEX.PL: Error: Link of 'Kernel32.mexw32' failed. > > ??? Error using ==> mex at 221 > Unable to complete successfully. > > Thanks for your help. > > DJ Ferris
 Subject: Compile error with Fortran 11.1 and R2009b Date: 24 Mar, 2010 16:15:22 Message: 3 of 6 Hey, where did you get the intelf11msvs2008opts.bat? I am searching for this for hours! I have the intel visual fortran compiler in version 11.1 and visual studio 2008 but don´t get mex -setup find the fortran comiler. Just c++ is listed. greetz, Maximilian
 Subject: Compile error with Fortran 11.1 and R2009b From: Christopher Rice Date: 14 Sep, 2010 02:06:20 Message: 4 of 6 "Felix Maximilian Möller" wrote in message ... > Hey, > > where did you get the intelf11msvs2008opts.bat? I am searching for this for hours! > > I have the intel visual fortran compiler in version 11.1 and visual studio 2008 but don´t get mex -setup find the fortran comiler. Just c++ is listed. > > greetz, > Maximilian Max: Make sure your version of MATLAB supports Intel Fortran 11.1 (2010a is the first???) I had 2009 and upgrading my version of MATLAB fixed the same problem you describe. JD: Have you solved the kernel32.lib issue? I am having the same problem and cannot seem to fix it.
 Subject: Compile error with Fortran 11.1 and R2009b From: Christopher Rice Date: 14 Sep, 2010 04:47:04 Message: 5 of 6 > Max: > > Make sure your version of MATLAB supports Intel Fortran 11.1 (2010a is the first???) I had 2009 and upgrading my version of MATLAB fixed the same problem you describe. > > JD: > > Have you solved the kernel32.lib issue? I am having the same problem and cannot seem to fix it. Well, it turns out the problem was in the install of VS2008. o fix the problem, I "reinstalled" my copy of VS 2008, then "repaired" the Intel Fortran compiler, then finally started MATLAB and ran mex -setup. At last, I am making MEX files...
 Subject: Compile error with Fortran 11.1 and R2009b From: hamid mehdizadeh Date: 17 Nov, 2011 16:04:13 Message: 6 of 6 Hi dudes I have also: Win7, 64 Matlab 2010a Intel visual fortran 11.1.0.64 VS 2008 Prof. But I can't make intel as my compiler to compile my fortran file to mex64. I'm pretty sure that file is correct, because I have converted it to mex32 on another system without any problem. Would please help me? "C Rice" wrote in message ... > > Max: > > > > Make sure your version of MATLAB supports Intel Fortran 11.1 (2010a is the first???) I had 2009 and upgrading my version of MATLAB fixed the same problem you describe. > > > > JD: > > > > Have you solved the kernel32.lib issue? I am having the same problem and cannot seem to fix it. > > Well, it turns out the problem was in the install of VS2008. o fix the problem, I "reinstalled" my copy of VS 2008, then "repaired" the Intel Fortran compiler, then finally started MATLAB and ran mex -setup. > > At last, I am making MEX files...
{"extraction_info": {"found_math": false, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.8579909801483154, "perplexity": 16214.761865606695}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 20, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2014-23/segments/1406510271862.24/warc/CC-MAIN-20140728011751-00453-ip-10-146-231-18.ec2.internal.warc.gz"}