简体   繁体   中英

How do I properly set up Visual Studio C++ projects on GitHub?

I need GitHub for syncing my project between two PCs that I'm working on. So that changes I commit and push could be easily pulled from another PC. I set up a GitHub repository, pushed my project to it and all works wonderfully until the second PC comes in. I clone the repo to second PC and when I press build hundreds of errors come up, mostly about being unable to open different source .h files. However if I just copy the code and create a project locally everything works. I can't understand whats the problem, could it be that PC have different paths to project folders? Or do I just do something wrong setting up the repo?

Also the first PC is running Win7 and the second is running Win10 if that's of any importance. Both have most up-to-date Visual Studio community.

hundreds of errors come up, mostly about being unable to open different source .h file

Sounds like dependency files are located in different locations in different PCs.

You could use relative path with macros like $(ProjectDir) , $(SolutionDir) , $(ProgramFiles) , $(WindowsSdkDir) , $(Path) etc to configure include and library directories in VS project properties.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM