mercredi 4 mars 2015

Linkage difference - #pragma comment(lib) vs. Project properties: Additional dependencies

So I have a Visual Studio 2013 Lib Project.

I using CryptProtectData function, so I'm linking crypt32.lib


Method 1 - Project properties: Additional dependencies


I added crypt32.lib to:


Configuration Properties => Librarian => General=> Additional Dependencies


Method 2 - #pragma comment(lib)


Added: #pragma comment(lib,"crypt32.lib") to the the cpp source file using CryptProtectData


Question


Why Method 1 generates this linker warning:



crypt32.lib(CRYPT32.dll) : warning LNK4006: __NULL_IMPORT_DESCRIPTOR already defined in mstask.lib(mstask.dll); second definition ignored


while Method 2 does not?


Notes:


Read the following posts with not luck:



Aucun commentaire:

Enregistrer un commentaire