- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi All,
I am using Intel Visual Fortran Composer 2013 with Microsoft Visual Studio 2012 to build an exe file. I got the following error message:
1 fatal error LNK1104: cannot open file 'SHELL32.LIB'
Can anyone please share with me some ideas of how to fix this issue?
Thanks,
Fengbin
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Check the LIB environment variable, and see if one of the paths included in it contains SHELL32.lib. For example, on my system LIB contains "C:\Program Files (x86)\Windows Kits\8.1\lib\winv6.3\um\x86", and inside that subdirectory I can see SHELL32.lib.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you very much for your comment, mecej4.
I checked C:\Program Files (x86)\Windows Kits\8.0\..., but found nothing was there. Do you think if this could be an installation problem?
Thanks a lot again.
Fengbin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
On my system, shell32.lib was probably installed when I installed VS 2013 Professional. The corresponding DLL, shell32.dll, is in C:\Windows\System32. Do you have this file on your system? You seem to have an earlier version of VS, namely, VS2012, so the files may be different even though the names are the same. Did you install VS2012 separately, or did IFort install the VS shell?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
If you are using Visual Studio 2012, then shell32.lib should be in the location mecej4 mentioned. It is supplied by VS2012, so it may be that your VS2012 installation is incomplete. Note that we never supplied a VS2012 shell, so this file comes from a Microsoft install.
Does shell32.lib exist anywhere on your system? (Ignore shell32.dll - it isn't of interest here.)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks a lot, Steve and mecej4.
This afternoon after I installed MS VS 2012 update 4, I found that shell32.lib is at C:\Program Files (x86)\Microsoft SDKs\Windows\v7.1A\Lib. But I still have the same error during compiling. I guess that I still need to properly set up a path in the system variables. Can you please let me know what I need to do next?
Again, thank you very much!
Fengbin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
To close this out, here's the general solution to the problem which worked for Fengbin.
shell32.lib, uuid.lib and other Windows API libraries are part of the Windows SDK. When building in Visual Studio, there is a per-user list of places the linker is told to look for library files - for Fortran you adjust this list under Tools > Options > Fortran > Compiler > Libraries. (The "Fortran" part varies a bit by Intel Fortran version.) In this list is "$(WindowsSDKDir)". This syntax with the $ and parenthesized name tells Visual Studio to substitute the value of the environment variable named in parentheses. But in this case, this is not a predefined variable - rather it gets created at link time based on a registry entry. What often happens is that installation of other Microsoft tools change this registry entry to something not containing the proper libraries.
The easiest solution is to locate where on your system the Windows API libraries have been placed. Note that there will be a folder for IA-32 architecture libraries and a folder for Intel 64 architecture libraries. Depending on the version of the Windows SDK installed, the IA-32 libraries may be under a folder named "ia32" or may just be in the "lib" folder directly. The Intel 64 libraries may be in a folder named "x64" or "amd64" (the latter is often under the folder containing the IA-32 libraries.)
Once you have determined the location, here's how to explicitly add it. In Visual Studio go to Tools > Options > Intel Parallel Studio XE > Visual Fortran > Compilers. With the Win32 tab selected, click on the ... button to the right of Compilers. Add the IA-32 path you found to the end of the list and click OK. Now click on the x64 tab, again click on the ... to the right of Libraries, and this time add the Intel 64 path to the list. Click OK, OK.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Steve,
Greatly appreciate your detailed comments. It helps a lot to solve my issue.
Best,
Fengbin

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page