visual studio - Setting linkage type for C++ library installed via Nuget -


this answer mentions following method link static version of c++ library [in case, "freeglut"] installed via nuget:

project->properties->configuration properties->referenced packages->freeglut->linkage (select static)  

with visual studio 2015 can't find "referenced packages". explicit reference nuget packages have packages.config xml file. if go "manage nuget packages" section of project can install or un-install can't find detail of package.

i have searched msdn documentation pages devoted creation of package, while need espress way consume such package. package in question (boost unit test framework) can used header-only, static or dynamic linkage , know can decide it.

maybe getting old, nuget bit magic me...

update

this seeing - can see there nuget packages installed, in particular boost, under configuration properties there no link "referenced packages": screenshot of nuget installed packages , of configuration properties without link "referenced packages

for completeness, version of vs 2015 enterprise is:

14.0.25431.01 update 3

and have checked when installed boost test package got both static (.lib) , dynamic (.dll) linkage versions, since files vs version present in packages folder.

with visual studio 2015 can't find "referenced packages".

it depends on whether have installed freeglut package project. if create c++ project without nuget package installed, not find "referenced packages":

enter image description here

after installed nuget package "freeglut", "referenced packages" , "project master settings" add configuration properties:

enter image description here

update boost package: should install package freeglut check "referenced packages" , "project master settings". since noticed different behavior between package freeglutand boost, provide more native nuget packages. after installed freeglut , boost in project, can find freeglut.targets , boost.targets in packages folder(..\packages\freeglut.2.8.1.15\build\native & packages\boost.1.64.0.0\build\native), open them notepad or vs, noticed that:

in freeglut.targets:

<propertygroup label="debug , static , runtimelibrarynull" condition="( $(configuration.tolower().indexof('debug')) &gt; -1 ) , '$(linkage-freeglut.tolower())' == 'static' , ('$(runtimelibrary)' == '')"> <runtimelibrary>multithreadeddebug</runtimelibrary>  </propertygroup>  <propertygroup label="release , static , runtimelibrarynull" condition="( $(configuration.tolower().indexof('debug')) == -1 ) , '$(linkage-freeglut.tolower())' == 'static' , ('$(runtimelibrary)' == '')"> <runtimelibrary>multithreaded</runtimelibrary> </propertygroup> <propertygroup label="debug , ltcg , runtimelibrarynull" condition="( $(configuration.tolower().indexof('debug')) &gt; -1 ) , '$(linkage-freeglut.tolower())' == 'ltcg' , ('$(runtimelibrary)' == '')"> <runtimelibrary>multithreadeddebug</runtimelibrary> </propertygroup> <propertygroup label="release , ltcg , runtimelibrarynull" condition="( $(configuration.tolower().indexof('debug')) == -1 ) , '$(linkage-freeglut.tolower())' == 'ltcg' , ('$(runtimelibrary)' == '')"> <runtimelibrary>multithreaded</runtimelibrary> </propertygroup> 

this add options "referenced packages" , "project master settings" via propertygroup in c++ properties.

but in boost.targets file, only:

   <itemdefinitiongroup>     <clcompile>       <preprocessordefinitions>;%(preprocessordefinitions)</preprocessordefinitions>       <additionalincludedirectories>$(msbuildthisfiledirectory)..\..\lib\native\include\;%(additionalincludedirectories)</additionalincludedirectories>     </clcompile>   </itemdefinitiongroup> 

so whether "referenced packages" , "project master settings" added based on .targets file in package`s folder.

if go "manage nuget packages" section of project can install or un-install can't find detail of package.

on right of "manage nuget packages" section of project, can notice more detail description:

enter image description here

i have searched msdn documentation pages devoted creation of package, while need espress way consume such package.

you can refer document consume packages how consume package.

the package in question (boost unit test framework) can used header-only, static or dynamic linkage , know can decide it.

you can decide on project->properties->configuration properties->referenced packages->freeglut:

enter image description here


Comments

Popular posts from this blog

ubuntu - PHP script to find files of certain extensions in a directory, returns populated array when run in browser, but empty array when run from terminal -

php - How can i create a user dashboard -

javascript - How to detect toggling of the fullscreen-toolbar in jQuery Mobile? -