[英]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. 我需要GitHub才能在正在使用的两台PC之间同步项目。 So that changes I commit and push could be easily pulled from another PC.
这样我提交和推送的更改可以很容易地从另一台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.
我建立了一个GitHub存储库,将项目推送到该存储库,并且一切正常,直到第二台PC出现为止。我将存储库克隆到第二台PC,当我按build时出现了数百个错误,主要是关于无法打开不同的源。 h个文件。 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?
我不明白问题出在哪里,可能是PC拥有指向项目文件夹的不同路径吗? 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. 如果有任何重要意义,第一台PC还将运行Win7,第二台PC将运行Win10。 Both have most up-to-date Visual Studio community.
两者都具有最新的Visual Studio社区。
hundreds of errors come up, mostly about being unable to open different source .h file
出现了数百个错误,主要是关于无法打开不同的源.h文件
Sounds like dependency files are located in different locations in different PCs. 听起来像依赖性文件位于不同PC的不同位置。
You could use relative path with macros like $(ProjectDir)
, $(SolutionDir)
, $(ProgramFiles)
, $(WindowsSdkDir)
, $(Path)
etc to configure include and library directories in VS project properties. 您可以将相对路径与
$(ProjectDir)
, $(SolutionDir)
, $(ProgramFiles)
, $(WindowsSdkDir)
, $(Path)
等宏一起使用, $(SolutionDir)
在VS项目属性中配置包含和库目录。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.