user841550
user841550

Reputation: 1075

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?

Upvotes: 1

Views: 5905

Answers (2)

SigTerm
SigTerm

Reputation: 26439

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.

Upvotes: 5

Vinnie Falco
Vinnie Falco

Reputation: 5353

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 (i.e. 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.

Upvotes: 1

Related Questions