I have a program that I made with OpenGL, but it doesn't work on PCs that don't have OpenGL installed. Is there a way to embed the necessary OpenGL files into the .exe file through the compiler?

Recommended Answers

All 5 Replies

Why not just package the required DLL's into a installer and ship them with your executable?

You could just simply put the files in a folder along with your exe too.

>Is there a way to embed the necessary OpenGL files into the .exe file through the compiler?
Yes, try statically linking the libraries, which will emebed all the necessary code into the final executable. Actual process to do such a thing varies from compiler to compiler.

The easiest way, however, is to include an installation app of the OpenGL runtime libraries. Usually how most commercial games nowadays are distributed, and it saves hard disk space.

Yes, try statically linking the libraries, which will emebed all the necessary code into the final executable. Actual process to do such a thing varies from compiler to compiler.

How would you do this in say... dev-cpp?

Actually... scratch that. I was thinking of Mesa (an OpenGL clone) when I said that. There is a static library, libopengl32.a, but I believe that this somehow references the symbols from the DLL file. Sorry. :-(

Anyhow, it seems strange that the test machines don't have OpenGL installed on them at all. Are you sure that opengl32.dll and glu32.dll doesn't exist somewhere on the hard drive? If not, well, then just package the DLLs with the program and hope for the best.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.