none
What path for CppUnitTest.h in project settings for VS2017? RRS feed

  • Question

  • In VS2015, I had to specify the following Additional Include Directories in order for my native unit tests to find the header CppUnitTest.h:

    $(VCInstallDir)UnitTest\include

    $(VCInstallDir)Auxiliary\VS\UnitTest\include

    and VCInstallDir itself resolved to C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\

    On a new machine, without any prior install of VisualStudio, in installed VS2017 Professional. Now, my same project won't compile because it can't find CppUnitTest.h.

    I looked on the system, and found it at the following path:

    C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\VC\Auxiliary\VS\UnitTest\include

    For VS2017, what macro+path should I specify for my unit tests project in order to locate CppUnitTest.h header?

    Monday, May 15, 2017 7:04 PM

All replies

  • Hi friend, 

    Thanks for you post.

    We have to apologize for the delay, as some issue happened to the MSDN forum which caused some threads did not show up in our end. We feel so sorry if this has brought you any inconvenience. 

    It is because of the change in the location of the include & lib directories for vc tools. Please update the paths in the .vcxproj file in the AdditionalIncludeDirectories & AdditionalLibraryDirectories variables.

    Updated variables will look something like this.

    Example:

    AdditionalIncludeDirectories - $(VCInstallDir)Auxiliary\VS\UnitTest\include;%(AdditionalIncludeDirectories)

    AdditionalLibraryDirectories - $(VCInstallDir)Auxiliary\VS\UnitTest\lib;%(AdditionalLibraryDirectories)

    There were earlier (in vs 2015)

    AdditionalIncludeDirectories - $(VCInstallDir)UnitTest\include;%(AdditionalIncludeDirectories)

    AdditionalLibraryDirectories - $(VCInstallDir)UnitTest\lib;%(AdditionalLibraryDirectories)

    Hope it helps. 

    Best regards, 

    Fletch 


    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.


    • Edited by Fletch Zhou Tuesday, May 23, 2017 12:33 PM
    • Proposed as answer by Fletch Zhou Tuesday, May 23, 2017 12:40 PM
    Tuesday, May 23, 2017 12:33 PM
  • Hi friend

    Is there any update of this issue. Please feel free to let me know if you need more help.

    Have a good day.

    Best regards,

    Fletch


    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.


    Saturday, May 27, 2017 7:02 AM