I must build several NuGet native (C/C++) packages that depend on other NuGet packages, then use them in a way they would provide all the needed libraries to be linked in the final application. For example, I pack Drogon as NuGet, including its ZLib dependency as another Nuget (because ZLib is used by several other NuGet packages that are or are not used at the same time by the same project). Then I use them in Visual Studio 2022. All the libraries are static, not dynamic/shared. Drogon build fine, it even finds the ZLib static lib file and version. When using Drogon NuGet, with ZLib declared as dependency in the .nuspec file, the client application cant be build due to linkage errors that lead to the fact that ZLib lib is not used. ZLib is needed by Drogon lib only, there's nothing referred from in in the client application directly. However, if I specify ZLib path to the .lib file in the project settings, it is found and linked properly. ZLib header files are found automatically, the explicit .lib path is the same as the one in the NuGet package targets, so it is not a path issue. How could it be done properly then? The end programmer should not need to add that path explicitly. What could be wrong?
linker - How to automatically use static libs refered by other static libs from a NuGet package - Stack Overflow
评论列表(0)
- 暂无评论