简体   繁体   English

我在笔记本电脑上找不到文件夹C:\\ Program Files(x86)\\ Microsoft Visual Studio 14.0 \\ VC \\ include \\ gl。 如何添加?

[英]I cannot find the folder C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\gl on my laptop. How do I add it?

Also does that mean opengl is not installed by default because I did check all the boxes when I installed visual studio community 2015. I couldn't find any clear answer anywhere. 这是否也意味着默认情况下未安装opengl,因为我在安装Visual Studio community 2015时确实选中了所有复选框。在任何地方都找不到清晰的答案。 I'm supposed to add glut and glew header files to the aforementioned folder where gl.h and glu.h should already be there. 我应该将glut和glew头文件添加到上述文件夹中,其中gl.h和glu.h应该已经存在。 But I couldnt find the folder include\\gl itself. 但是我找不到文件夹include \\ gl本身。

Also does that mean opengl is not installed by default because I did check all the boxes when I installed visual studio community 2015. I couldn't find any clear answer anywhere. 这是否也意味着默认情况下未安装opengl,因为我在安装Visual Studio community 2015时确实选中了所有复选框。在任何地方都找不到清晰的答案。

You have to distinguish between: 您必须区分:

  • a fully featured OpenGL driver being installed (which unfortunately doesn't happen by default on Windows) 已安装功能齐全的OpenGL驱动程序(不幸的是,Windows默认情况下不会发生)

  • the OpenGL development support files being available for your compiler environment. OpenGL开发支持文件可用于您的编译器环境。

As far as the compiler environment is concerned, since OpenGL-1.1 has been part of the Windows ABI contract since Windows-NT-4 all compilers that target the Windows-32 API must ship with the required support files. 就编译器环境而言,由于自Windows-NT-4起OpenGL-1.1已成为Windows ABI合同的一部分,所有以Windows-32 API为目标的编译器都必须附带必需的支持文件。

To check if your compiler installation is complete try to compile and execute the following little program: 要检查编译器安装是否完成,请尝试编译并执行以下小程序:

#include <windows.h>
#include <GL/gl.h>
#include <stdio.h>

#pragma comment(lib, "opengl32.lib")

int main(int argc, char *argv[])
{
    if( &glGetError ) {
        fprintf(stderr, "OpenGL glGetError symbol available\n");
    }
}

It does not actually call an OpenGL function, but compiling it requires to link against opengl32.lib and testing for the symbol glGetError being non-NULL makes sure the linker will pull in a reference. 它实际上并没有调用OpenGL函数,但是编译它需要链接到opengl32.lib并测试符号glGetError为非NULL以确保链接器可以插入引用。

I'm supposed to add glut and glew header files to the aforementioned folder 我应该将glut和glew头文件添加到上述文件夹中

Don't! 别! Never put anything manually into installation directories of the compiler toolchain. 切勿手动将任何东西放入编译器工具链的安装目录中。 Always configure an auxiliary directory structure for header and library files, that you add to your projects' compiler include and linker search paths. 始终为头文件和库文件配置辅助目录结构,您将它们添加到项目的编译器包含和链接器搜索路径中。

Install GLEW there. 在那里安装GLEW。 If you got the instructions to install GLEW into the compiler toolchain directory, disregard any other advice coming from the same source, as whoever is the source is apparently clueless about proper DevOps. 如果您有将GLEW安装到编译器工具链目录中的说明,请忽略来自同一来源的任何其他建议,因为无论来源是谁,显然都不适合使用正确的DevOps。

Update due to question in comment 由于评论中的问题而更新

In software development using 3rd party libraries is commonplace. 在使用第三方库的软件开发中,司空见惯。 You normally want to collect those libraries at a common location. 通常,您希望在公共位置收集这些库。 Such libraries usually consist of header files, binaries and on some operating systems additional linker stubs. 这样的库通常由头文件,二进制文件以及在某些操作系统上的附加链接程序存根组成。 The binaries are built for a specific operating system and the linker stubs are made for specific compilers. 这些二进制文件是为特定的操作系统构建的,而链接程序存根是为特定的编译器构建的。

The following would be such a directory structure, inspired by the way *nix OSs organize their stuff 以下是这样的目录结构,灵感来自* nix操作系统组织其内容的方式

  • /local/include/ gets all the headers /local/include/获取所有标题
  • /local/i686-windows/bin 32 bit Windows extra tooling executables /local/i686-windows/bin 32位Windows额外工具可执行文件
  • /local/i686-pc-linux-gnu/bin 32 bit Linux extra tooling executables /local/i686-pc-linux-gnu/bin 32位Linux额外工具可执行文件
  • /local/i686-windows/lib 32 bit Windows DLLs /local/i686-windows/lib 32位Windows DLL
  • /local/i686-windows/libmsvc 32 bit Visual C++ linker stubs and static libraries /local/i686-windows/libmsvc 32位Visual C ++链接程序存根和静态库
  • /local/i686-windows/libmingw 32 bit GNU MinGW linker stubs and static libs /local/i686-windows/libmingw 32位GNU MinGW链接程序存根和静态库
  • /local/i686-pc-linux-gnu/lib 32 bit Linux SOs and static libraries /local/i686-pc-linux-gnu/lib 32位Linux SO和静态库
  • /local/x86_64-windows/bin 64 bit Windows extra tooling executables /local/x86_64-windows/bin 64位Windows额外工具可执行文件
  • /local/x86_64-pc-linux-gnu/bin 64 bit Linux extra tooling executables /local/x86_64-pc-linux-gnu/bin 64位Linux额外工具可执行文件
  • /local/x86_64-windows/lib 64 bit Windows DLLs /local/x86_64-windows/lib 64位Windows DLL
  • /local/x86_64-windows/libmsvc 32 bit Visual C++ linker stubs and static libraries /local/x86_64-windows/libmsvc 32位Visual C ++链接程序存根和静态库
  • /local/x86_64-windows/libmingw 32 bit GNU MinGW linker stubs and static libs /local/x86_64-windows/libmingw 32位GNU MinGW链接程序存根和静态库
  • /local/x86_64-linux-gnu/lib 64 bit Linux SOs and static libraries /local/x86_64-linux-gnu/lib 64位Linux SO和静态库

Ok, so the above list may be a little bit excessive for a simple development environment. 好的,因此对于简单的开发环境,上面的列表可能有点过多。 But say you're targeting 64 bit Windows, using the Visual C++ compiler, then you'd create a directory structure 但是,假设您要使用Visual C ++编译器定位64位Windows,则需要创建目录结构

  • /local/include/
  • /local/x86_64-windows/bin
  • /local/x86_64-windows/lib
  • /local/x86_64-windows/libmsvc

You'd add GL/glut.h and GL/glew.h (and the other header files) beneath /local/include , eg 您可以在/local/include下添加GL/glut.hGL/glew.h (以及其他头文件),例如

/local/include/GL/glxew.h
/local/include/GL/glew.h
/local/include/GL/glut.h
/local/include/GL/wglew.h

The .lib files you put into /local/x86_64-windows/libmsvc and the DLLs into /local/x86_64-windows/lib . 您放入/local/x86_64-windows/libmsvc.lib文件,以及DLL到/local/x86_64-windows/lib的DLL。 Then in your project build settings you can simply add /local/x86_64-windows/libmsvc as a linker search path. 然后,在项目构建设置中,您可以简单地将/local/x86_64-windows/libmsvc为链接器搜索路径。 For the DLLs you should add /local/x86_64-windows/lib to your systems environment PATH variable, so that they are found when executing the programs you built. 对于DLL,您应该将/local/x86_64-windows/lib到系统环境PATH变量中,以便在执行所构建的程序时可以找到它们。 For deployment of those programs copy the required DLLs beside the EXE file. 为了部署这些程序,请在EXE文件旁边复制所需的DLL。

暂无
暂无

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

相关问题 Visual Studio致命错误C1084:无法读取包含文件:&#39;c:\\ program files(x86)\\ microsoft visual studio 10.0 \\ vc \\ include \\ map&#39;:权限被拒绝 - Visual Studio fatal error C1084: Cannot read include file: 'c:\program files (x86)\microsoft visual studio 10.0\vc\include\map': Permission denied 1 IntelliSense:预期为&#39;)&#39;c:\\程序文件(x86)\\ Microsoft Visual Studio 10.0 \\ vc \\ include \\ crtdefs.h 551 13-构建时出现Visual Studio错误 - 1 IntelliSense: expected a ')' c:\program files (x86)\microsoft visual studio 10.0\vc\include\crtdefs.h 551 13 - Visual Studio Error while building C++ | 如何删除位于 (C:\Program Files (x86)) 的文件夹中的文件 - C++ | How can i delete files in a folder located in (C:\Program Files (x86)) 如何将C ++子例程链接到x86汇编程序? - How do I link a C++ subroutine to an x86 assembly program? 在Visual Studio &#39;13中,我该怎么做,以便可以在exe的相对子文件夹中包含dll文件? - In visual studio '13 how do I make it so I can include dll files in a relative sub folder of my exe? 在 Microsoft Visual Studio 的 x86 C++ 应用程序中集成犰狳 - Integration of Armadillo in x86 C++ Application in Microsoft Visual Studio 文件夹“Microsoft Visual Studio 14.0”丢失 - Folder "Microsoft Visual Studio 14.0" Is Missing 我想使用64位整数可以接受的全部范围。 如何在x86 Visual Studio 2008中做到这一点? - I want to use the full range that the 64-bit integer can take. How can I do it in x86 Visual Studio 2008? 复制到程序文件(x86)时无法执行我的DLL - Cannot execute my DLL when copied to Program Files (x86) &#39;CObject :: CObject&#39;:无法访问在&#39;CObject&#39;d:\\ Program Files \\ Microsoft Visual Studio 9.0 \\ vc \\ atlmfc \\ include \\ afxcoll.h中声明的私有成员 - 'CObject::CObject' : cannot access private member declared in class 'CObject'd:\program files\microsoft visual studio 9.0\vc\atlmfc\include\afxcoll.h
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM