简体   繁体   English

如何在GitHub上正确设置Visual Studio C ++项目?

[英]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.

相关问题 如何在Visual Studio 2010中的C ++ googletest项目中设置代码覆盖率 - How do I set up code coverage in C++ googletest project in Visual Studio 2010 如何设置Vim以使用Visual Studio 2010的C ++编译器进行编译? - How do I set up Vim to compile using Visual Studio 2010's C++ compiler? 设置 Visual Studio 以启用对其他项目的访问以及如何使项目能够相互引用 (C++) - Set up Visual Studio to enable Access to other projects and how to make projects able to reference each other (C++) 如何在Visual Studio中的项目之间共享C ++源代码文件? - How do I share C++ source code files between projects in Visual Studio? 如何为 Visual Studio C++ 设置单元测试 - How to set up unit testing for Visual Studio C++ 用于并行计算的C ++ + openmp:如何在visual studio中进行设置? - C++ + openmp for parallel computing: how to set up in visual studio? 如何在Visual Studio 2008(C ++项目)中重建项目后运行构建规则的项目 - How do I just run a projects post build rules with out rebuilding in Visual Studio 2008 (C++ project) 如何设置此Visual Studio(2015)自定义构建步骤(工具?)。 基本上我想要一个预处理器步骤,用于修改头文件(C ++) - How do I set up this visual studio (2015) custom build step (tool?). Basically I want a pre-preprocessor step that modifies header files (c++) 为什么我们在Visual Studio 2013中引用C ++项目? - Why do we reference C++ projects in Visual Studio 2013? 如何在大型 C++ 项目的可视化代码中设置调试 - How do I set up debugging in visual code for a large c++ project
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM