SinisterMJ
SinisterMJ

Reputation: 3509

Visual Studio 2012 cannot find shlwapi.lib

I recently migrated my project from VS2010 to VS2012 (2010 would crash on compiling a framework required, 2012 would do it just fine), but now it won't find the shlwapi.lib

I added

$(WindowsSDK_IncludePath);
$(WindowsSDK_LibraryPath_x86); 

to the directory settings, is there anything else needed to be added?

Edit: complete output from build.

2>------ Build started: Project: MachineLearning, Configuration: Debug Win32 ------
2>  MachLearning.cpp
1>LINK : warning LNK4075: ignoring '/INCREMENTAL' due to '/LTCG' specification
1>LINK : fatal error LNK1181: cannot open input file 'Shlwapi.lib'
2>d:\development\glukosescanner\machinelearning\source\machlearning.cpp(65): warning C4244: 'initializing' : conversion from 'double' to 'int', possible loss of data
2>d:\development\glukosescanner\machinelearning\source\machlearning.cpp(79): warning C4244: 'initializing' : conversion from 'double' to 'int', possible loss of data
2>  libfftw-3.3-x86.lib(execute.obj) : MSIL .netmodule or module compiled with /GL found; restarting link with /LTCG; add /LTCG to the link command line to improve linker performance
2>LINK : warning LNK4075: ignoring '/INCREMENTAL' due to '/LTCG' specification
2>MachLearning.obj : warning LNK4075: ignoring '/EDITANDCONTINUE' due to '/OPT:LBR' specification
2>LINK : warning LNK4098: defaultlib 'MSVCRT' conflicts with use of other libs; use /NODEFAULTLIB:library
2>  Generating code
2>  Finished generating code
2>  MachineLearning.vcxproj -> D:\Development\GlukoseScanner\GlucoseControl\Debug\MachineLearning.exe
========== Build: 1 succeeded, 1 failed, 6 up-to-date, 0 skipped ==========

Upvotes: 0

Views: 4310

Answers (1)

stijn
stijn

Reputation: 35901

Possibly the project upgrade went wrong, but in any case your project settings are not correct it seems. WindowsSDK_LibraryPath_x86 etc should already be there by default, and also messages like defaultlib 'MSVCRT' conflicts with use of other libs indicate you are mixing different compiler/linker options across projects.

Anyway first make sure you do have shlwapi.lib: confirm that you have that directory on disk and shlwapi.lib inside it, just to check your VS installation is ok.

Then create a blank new C++ project file and add your current source files to it, add include directories/libraries or preprocessor options that are required. But just that. Then build. That should eventually work out, and then you can compare your new project with the old one to see what is wrong. Or, just use the new project..

Also make sure all projects (like fftw etc, casue that also seems to have again different settings) are built using the same settings. Easiest way to accomplish that is a single property sheet with all compiler/linker options shared by all projects. I highly recommend looking up how that works (it's simple) and use it consistently.

Upvotes: 1

Related Questions