Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NuGet package: 'AdditionalIncludeDirectories' not working in VS 2022 #902

Closed
sven-molkenstruck opened this issue Apr 26, 2023 · 2 comments · Fixed by #912
Closed

NuGet package: 'AdditionalIncludeDirectories' not working in VS 2022 #902

sven-molkenstruck opened this issue Apr 26, 2023 · 2 comments · Fixed by #912

Comments

@sven-molkenstruck
Copy link
Contributor

sven-molkenstruck commented Apr 26, 2023

Hi,
Thanks @simon-berger for the NuGet package! In my VS 2022 project the <AdditionalIncludeDirectories> entry in libcpr.props does not seem to work here although everything looks right. The compiler just does not find the folder when I try to
#include "cpr/cpr.h"
--> fatal error C1083: Cannot open include file: 'cpr/cpr.h': No such file or directory

(It does work when I add the folder manually to my project's AdditionalIncludeDirectories.)

I thought that it is necessary to add
\;%(AdditionalIncludeDirectories) to the line (other projects do that), making it
<AdditionalIncludeDirectories>$(MSBuildThisFileDirectory)\$(Platform)\$(Configuration)\include\;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
but that does not seem to solve it here.

When I copy the <ItemDefinitionGroup> / <ClCompile> / <AdditionalIncludeDirectories> nodes from libcpr.props into libcpr.targets, it works fine here. Is that necessary? Apparently in your tests it wasn't.

What do you think?

Thanks!
Sven

@simon-berger
Copy link
Contributor

Hi @Sven-HP ,

First of all, thank you for your comment and suggestion for improvement and sorry for my late reply, but I am quite busy with other projects at the moment.
Currently I don't have time to test your change and don't know exactly why the error occurs, but if it solves the problem, feel free to create a pull request with your fix.

Best regards
Simon

@sven-molkenstruck
Copy link
Contributor Author

Done. See #912
@simon-berger

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants