How to make OpenGL apps in 64-bit Windows?

前端 未结 2 549
臣服心动
臣服心动 2020-12-30 02:26

My project compiles, link and run in xp32 then I tried to cross compile it to x64 and I came across a lot of questions:

  1. There\'s no native x64 instalable OpenG
相关标签:
2条回答
  • 2020-12-30 02:43

    The OpenGL static and dynamic libraries OpenGL32.lib and opengl32.dll for 32-bit or 64-bit applications come with the OS and are now respectively in the Windows directories listed below. Just keep in mind that the 32-bit and the 64-bit OpenGL (and glew) libraries are named the same for historical reasons.

    If you are using Visual Studio in Windows, no need to copy the opengl32.dll library in your Debug or Release directories where is your .exe or the path to OpenGL32.lib in Visual Studio - only add "Opengl32.lib" in Properties, Linker, Input, then Additional Dependencies.

    C:\Program Files (x86)\Windows Kits\10\Lib\10.0.14393.0\um\x86
    C:\Windows\System32
    
    C:\Program Files (x86)\Windows Kits\10\Lib\10.0.14393.0\um\x64
    C:\Windows\SysWOW64
    
    0 讨论(0)
  • 2020-12-30 02:47

    The 64-bit OpenGL import library is included in the Windows SDK and gets installed to %ProgramFiles%\Microsoft SDKs\Windows\<version>\Lib\x64\OpenGL32.lib. The corresponding DLL is named opengl32.dll and is located in %SystemRoot%\system32. The 32-bit version is also named opengl32.dll and is located in %SystemRoot%\syswow64 on 64-bit Windows.

    You can't load 32-bit DLLs in a 64-bit process, so whatever you read about x64 apps using the 32-bit OpenGL DLL was incorrect. There is definitely a 64-bit OpenGL DLL, but it has "32" in its name, presumably to make porting easier.

    0 讨论(0)
提交回复
热议问题