2

I've created an empty C++ project, added main.cpp, and set up build configurations. Particularly, I changed Output Directory and Intermediate Directory. Pushed everything to GitHub, and cloned it to the other computer. Opened solution, checked properties of the project to find out that it is now set back to default. Tried compiling, wrong directories are used. git status on both computers shows nothing. I also checked .vcxproj to find out that changed strings are present in the file.

What could be the cause of this behavior?

Repository: https://github.com/kirdaybov/experiments

My environment:

  • 1st computer: VS Express 2015 update 1.
  • 2nd computer: VS Community 2015 update 3.
Kirill Daybov
  • 480
  • 3
  • 19

2 Answers2

3

This happens to me all the time!

VS has the nasty habit of not saving project and solution options, even when you configure it to "Save to Compile", or even when you click the "Save" button.

You must click the "Save All" button. Or to be extra safe, close VS before committing.

Or could be caused because one of the computers is compiling the "Debug" configuration while the other is compiling the "Release" one. Or one is compiling the "Any CPU" and the other the "x86". Note that the "current configuration" option is not pushed to the repository.

rodrigo
  • 94,151
  • 12
  • 143
  • 190
  • The thing with platform helped, thank you! I chose "All configurations" when I was setting things up but there is no "All platforms" options (would be a nice feature btw). And PC1 was set to x86 while PC2 was set to x64. Changing it to x86 restored my settings. – Kirill Daybov Apr 01 '17 at 17:53
  • @KirillDaybov: what I usually do is delete the platforms I'm not interested in. Less options to configure mean less mistakes. – rodrigo Apr 01 '17 at 18:05
0

Some updates MIGHT change libraries directory. I had this moment when I changed from VS2015 to VS2017 and nothing worked anymore.

Also try to see the directories in the settings. A project could be on CPU1's desktop, but on CPU's 2 document folder. In other words, check project propreties.

Dat Ha
  • 562
  • 1
  • 9
  • 16