简体   繁体   中英

Statically linked OpenGL library on Windows

I want to get ( or build from source) OpenGL library that is statically linked to the crt on Windows.

I don't want my executable to require OPENGL32.dll.

My compiler is Visual C++ 9.

Where do I begin? The OpenGL website directs me to this wiki http://www.opengl.org/wiki/Getting_started But that wiki tells me "In all three major desktop platforms (Linux, MacOS X, and Windows), OpenGL more or less comes with the system". I am on Windows. Is this statement true. How do I verify this?

Statically linked OpenGL library on Windows

I don't want my executable to require OPENGL32.dll.

Impossible. End of story. opengl32.dll is provided by microsoft and may be changed after each system update. So you can't static-link it - it is a system component.

You can only static link with mesa3d which emulates OpenGL on CPU. However, it is not fully compliant to OpenGL, so you can get unexpected problems, and you'll still require several system dlls. (my bet is gdi32.dll) for your application. Also, performance will be very bad compared to normal OpenGL.

I believe what you are saying is that you don't want to be forced to make your application link with the C Runtime libraries dynamically (ie Multithreaded DLL or Multithreaded Debug DLL in the Properties/C++/Code Generation/Runtime Library setting).

Since OpenGL is a system provided .DLL, you are still free to choose Multithreaded or Multithreaded Debug (both choices statically link to the C Runtime) for your Runtime Library when using OpenGL.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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