none
Visual Studio 2017 mangling include directories? RRS feed

  • Question

  • I've just begun using a new windows 10 computer, with a new installation of VS2017 Enterprise.

    I have a solution containing several C++ projects, and a bunch of #include statements now have those wonderful red underlines. If I try to 'open' the include file, I get an error like the following:

    https://ibb.co/cCz0JPn

    If I look at the project configuration, for the current configuration, and look at the additional include directories, I see the following:

    https://ibb.co/rtr59W7

    So, for some reason, it looks like it's removing the 'C:\perforce' prefix from the directories. The same project file works fine on my old Windows 7 computer.

    SIMBAENGINE_DIR/SIMBAENGINE_THIRDPARTY_DIR/SIMBASHARED_DIR are all environment variables, set to 'C:\perforce\SimbaEngine\Maintenance\10.1\Product'/'C:\perforce\ThirdParty'/'c:\perforce\SimbaShared', respectively.

    Not sure where to start debugging this...

    https://ibb.co/s9BL10f

    Thursday, September 5, 2019 8:20 PM

All replies

  • Deleting the .user file for that project seems to have fixed the issue for that project, but another project still has the issue (but only for some include directories, not all...), and there doesn't seem to be any .user file to delete for it.
    Thursday, September 5, 2019 8:40 PM
  • If it is an IntelliSense problem only (no compilation errors), then try right-clicking inside any source file, then select “Rescan”, “Rescan Solution”.

    Friday, September 6, 2019 5:00 AM
  • Hi Matthew,

    Thank you for posting here.

    Like what Viorel said, lntelliSense might cause this issue, please follow the steps that Viorel mentioned above and check whether it worked.

    You could also try to close vs and delete .vs folder which is hidden in solution folder, start vs and unload project then reload project (also delete .user folder like what you said) and check whether this issue could be resolved.

    Any feedback will be expected.

    Best Regards,

    Tianyu


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Friday, September 6, 2019 6:31 AM
  • It wasn't compiling either, so not just intellisense.

    I'll try your suggestion later today, thanks.

    Friday, September 6, 2019 5:12 PM
  • If it isn't compiling then that is a different issue.

    The build engine inside Visual Studio reads the build configuration every time instead of caching things like intellisense does. This means that if a project fails to compile, the configuration is bad.

    This means that you should build the entire solution and use the actual Visual C++ compiler output to figure out where the real problems are, and use this to guide your attempts at fixing things. This can help with individual project configuration errors too, since if one project is able to find headers but another isn't, then you have messed up the configuration of one project.


    This is a signature. Any samples given are not meant to have error checking or show best practices. They are meant to just illustrate a point. I may also give inefficient code or introduce some problems to discourage copy/paste coding. This is because the major point of my posts is to aid in the learning process.

    Friday, September 6, 2019 5:52 PM
  • Hi Matthew,

    Thank you for feedback.

    Did you check whether the file is exactly in the specified directory like the error message said, since if you change computer, the directory might be changed.

    If you couldn’t find the specified files in the directory, you might need to confirm where the specified files are located and change the include path to point to this directory (You could add or modify the path in Additional Include Directories). If you could find the specified files in the directory, please try to build your solution like Darran said and check the error message in Error List window.

    Any feedback will be expected.

    Best Regards,

    Tianyu


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Tuesday, September 10, 2019 9:21 AM
  • Hi Matthew,

    Sorry to disturb you. Did you have any update? Did you try the suggestions above?

    If our replies are helpful for you to solve your issue, please remember to mark as answer, so that other members of forum who have the similar issue could refer to this thread.

    If this issue still persists, could you please try to build the program and share us with error message in Error list window so that we could help you better.

    Thank you for your understanding.

    Best Regards,

    Tianyu


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Tuesday, September 17, 2019 8:26 AM
  • I've downgraded to VS2015 for now, I'll try the suggestions provided when/if I have time to look into this again, or really need VS2017
    Wednesday, September 18, 2019 12:01 AM
  • Hi Matthew,

    Thank you for your feedback.

    If you still have this issue after you test with VS 2017 in the future, please feel free to contact us, and we will try our best to help you.

    Have a nice day.

    Best Regards,

    Tianyu


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Wednesday, September 18, 2019 7:56 AM