简体   繁体   English

Visual Studio构建C ++程序

[英]Visual Studio build C++ program

I am using Visual Studio 2013 to build a C++ program. 我正在使用Visual Studio 2013生成C ++程序。 I downloaded the source code of the program on Nov 12th (eg Revision 10), and built it successfully. 我于11月12日下载了程序的源代码(例如,修订版10),并成功构建了它。 Then I updated the source code using TortoiseSVN to the revisions on Nov 14th (eg, Revision 12), and got an fatal error when I build it: "Cannot open file: glew32.lib". 然后,我使用TortoiseSVN将源代码更新为11月14日的修订版(例如,修订版12),并且在构建它时收到致命错误:“无法打开文件:glew32.lib”。 Then I tried to checkout Revision 10, which was error free before. 然后,我尝试签出版本10,该版本之前没有错误。 But I still got the same error. 但是我仍然遇到同样的错误。 OK. 好。 Then I restored the whole folder of the code to Nov 12th, I still got the same error. 然后,我将代码的整个文件夹还原到11月12日,我仍然遇到相同的错误。

I am totally confused as what has happened, as it looks like I cannot even just go back? 我对所发生的事情完全感到困惑,因为看起来我什至不能回去吗? Anybody can help brainstorming? 有人可以帮助集思广益吗?

在此处输入图片说明

Add path to your .lib file in "Library directories". 在“库目录”中将路径添加到您的.lib文件。

Then add library to linker via either: 然后通过以下任一方式将库添加到链接器:

  1. #pragma comment(lib, "glew32.lib") in any source file. 任何源文件中的#pragma注释(lib,“ glew32.lib”)。 Note, that this "visual studio-only" method of linking libraries, it wont work in GCC\\Clang. 请注意,这种链接库的“仅用于Visual Studio”的方法在GCC \\ Clang中不起作用。

  2. In project properties -> Linker -> Input -> Additional dependences - add glew32.lib here. 在项目属性->链接器->输入->其他依赖关系中-在此处添加glew32.lib。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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