Category Archives: How to Fix

0028opengl program running prompt glut32.dll missing one of the solutions

From: http://blog.csdn.net/liufeng520/article/details/8064170
My question is exactly the same as above, so make a note of it for later review and reference.
Today debug OpenGl source program, compiled through, but a running tips, computer lost glut32. DLL files, not depressed, search under the Internet provide most of the practice are more, copying the file to download this file to C: \ WINDOWS \ system in 32, but did so after found that still doesn’t work, after a long afternoon, suddenly realized that may be about my new WINDOWS 7 system, but also for loading is 64 – bit, then, Try to copy this glut32.dll to your SysWOW64 folder in C:\ Windows, and it will all be OK. Here’s a special note to remind everyone who installed Windows 7 and VC ++ 6.0 to pay attention to it.
PS: just started contact with OpenGl will inevitably encounter some problems, these problems may has nothing to do with program, just some compile environment Settings and header files installed, adjusted in particular, are as follows:
(1) Copy gult32.dll, Glut. DLL to Windows system system32(if Windows 7 is a 64-bit operating system, it is in C:\ Windows SysWOW64 file)
(2) Copy gult32.lib, Glut. lib to VC lib directory
(3) Copy ULT. H to include\GL of VC

Solution to the problem that OpenGL can’t find glew32.dll in vs2019

#define GLEW_STATIC
#define GLEW_STATIC
#define GLEW_STATIC
#define GLEW_STATIC
#define GLEW_STATIC
#include < GL/glew.h>
#include < GLFW/glfw3.h>
#include
# pragma comment (lib, “glew32. Lib”)
int main() {

glfwInit();
glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3);
glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 3);
glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE);


// Open GLFW Window
GLFWwindow* window = glfwCreateWindow(800, 600, "My OpenGL Game", NULL, NULL);

if (window == NULL)
{
	printf("open window failed");
	glfwTerminate();
	return -1;
}

glfwMakeContextCurrent(window);

// Init GLEW
GLboolean glewExperimental = true;
if (glewInit() != GLEW_OK)
{
	printf("init GLEW failed");
	glfwTerminate();
	return -1;
}

glViewport(0, 0, 800, 600);

while (!glfwWindowShouldClose(window))
{
	glfwSwapBuffers(window);
	glfwPollEvents();
}

glfwTerminate();
return 0;

}
Glew32.dll

1

1

1

1

1

1

br>
> You need to enter the C disk with admin privileges, then put a copy of glew32.dll into C:\Windows\SysWOW64, the problem is fixed, the window appears

|-OpenGL – | some small problems about the glut Library

When you’re using OpenGL, if you can’t find the header file Glut. h, you probably don’t have a GLUT library installed on your computer
Install the glut library
1. Download the GLUT library toolkit
The glut library download address: http://www.opengl.org/resources/libraries/glut/glutdlls37beta.zip
2. The location of the GLUT library file


br>

Glut. H file
Placement is: C: \ Program Files \ Windows (x86) Kits \ \ Include \ 8.1 um \ gl

if you don't know oneself should put in that position, you can directly search gl. H to find this file in folder, or in the compiler directly see the gl. H file placement position, then put the glut. H on with gl. H with folder

Glut. Lib and glut32. Lib
Know the glut. H after placed the folder, it is convenient for many
is placed as follows: C: \ Program Files \ Windows (x86) Kits \ \ Lib \ winv6.3\8.1 um \ x64 and C: \ Program Files \ Windows (x86) Kits \ \ Lib \ winv6.3\8.1 um \ x86



Glut. DLL and glut32. DLL

C:\ windows\ System32
br> a>
>
: \ windows\ System32


>
C:\ windows\ System32

Lost in computer OPENGL.dll

When developing an OpenGL project, an error like the one shown in the figure can occur in the VS development environment.
OpenGL32.dll exists in the C :\ Windowssystem32 and SysWow64 folders. The program will compile normally, but will be prompted as soon as the program is running
“Could not start this program because OpenGL. DLL is missing from your computer. Try reinstalling the program to fix the problem.”
This is mainly due to the reference to both the static libraries “Glut.lib” and “Glut32.lib”.
That is, in the project ->; Property – & gt; Configure properties ->; The linker – & gt; Glut.Lib and Glut32.Lib are added to the attached dependencies, and Glut.DLL comes first, glut32.DLL comes second, so the linker first looks for OpenGl32.DLL instead of OpenGL32.DLL.
In addition, if you want to reproduce this error in VS, you need to rebuild the project after configuring the additional dependencies.

[OpenGL] cannot start this program because the computer is missing glut32.dll. Try to re install the program to fix this problem. …

An error is reported when running OpenGL program, as shown in the figure:

Solution: Copy glut32.dll to the C:\ windows\ SysWOW64 directory instead of to the C:\ windows\ System32 directory as the online tutorial does.
Because my system is Win10 64-bit, the folder SysWOW64 is used to run 32-bit software.

Reproduced in: https://www.cnblogs.com/huahai/p/7270952.html

Solutions to the problem that CodeBlocks cannot be used

It is possible to fail to run on newly installed codeblocks and
with the following error message
“HelloWord – Debug” : The compiler’s setup (GNU GCC compiler) is invalid, so Code::Blocks cannot find/run The compiler.
Probably The toolchain path within The compiler options is not setup correctly?! (Do you have a compiler installed?)
Goto “Settings – & gt; The Compiler… -> Global compiler settings-> GNU GCC Compiler-> Toolchain executables “and fix the compiler’s setup.
Nothing to be done (all items are up-to-date).
This is simply a missing configuration file or the wrong location of the root directory of the configuration file
Open Settings-> when prompted; The Compiler… -> Global compiler settings-> GNU GCC Compiler-> Toolchain executables

We can see that the default directory address is C:\MinGW
The following prompt cannot be found
If there is no MinGW in this file
download address: click enter
It is generally best to unzip to the root directory of codeblocks

Then in
Settings->; The Compiler… -> Global compiler settings-> GNU GCC Compiler-> Toolchain executables
To change the root address I have D:\codeblocks\MinGW
Then running the program is no problem

Create an OpenGL project in codeblock

This semester’s graphics need to use OpenGL, but the teacher configured OpenGL in class is VS2010, I don’t know what is wrong with my computer. Several installs of VS2010 are useless. So I went online to find out how to configure OpenGL in Codeblock. But many of them are useless. Very not easy to find the method is feasible in this blog (assault delete) : http://blog.csdn.net/yang_7_46/article/details/24674849
The resources I also uploaded to: http://download.csdn.net/detail/qq_33276623/9468487
Specific configuration method (yes I was the screenshot. Face covering) : Ahah

How do you create the project once you’ve configured it?
1. The file – & gt; New – & gt; For the project, select GLUT Project

The following steps are done by themselves. This is it

You need to select MinGW, and the next step is to create it successfully.
If you want to add files to the Codeblock project, select the project -> from the top function bar; Just add it.

Codeblock configuring OpenGL

The article reprinted: thank if Chen at https://blog.csdn.net/sunny_xsc1994/article/details/44301841

1.2 a complementary
if after the previous configuration still doesn’t work, can also be so give it a try. Right-click Project-> on an existing Project; Build Option, add the following in Linker Settings:
glut32
opengl32
glu32
winmm
gdi32
glaux

I was a program configuration how can not run up, and then listen to a classmate’s advice, according to his practice, add the above several, and then OK. I don’t know where he found such a scheme. I don’t know if it’s a coincidence, but I’ll write it down first.

1.3 two very tangled problems
but painfully two problems, other students basic didn’t meet, I must have met… Compiling is not through, tangled, and then according to the following method to get it done.


All in all a lot of red errors…

define _STDCALL_SUPPORTED
#define _STDCALL_SUPPORTED
#define/stdcall_supported
#define/stdcall_supported
#define/stdcall_supported
#define/stdcall_supported
#define/stdcall_supported
#define/stdcall_supported
#define/stdcall_supported
There you go, just write this at the very beginning of your code.
No. 2

error: redeclaration of c + + built – in type ‘would be’ [- fpermissive]
text will jump out of a code, there are so few lines

use Google search, you can refer to this person to answer the question why

If wchart is already defined (to short for example), butthe
hartdefined macro is not, the line will then be treated as:
t>ef unsigned short short;
Which is a redeclaration of the built-in type. (don’t use the .h btw, it’s not used anymore per standard) is adding defines such that the typedef is not executed, or undef’ing wchar_t if it is a macro such that the typedef is legal.

#define _WCHAR_T_DEFINED
#define _WCHAR_T_DEFINED
#define _WCHAR_T_DEFINED
#define
Then my problem solved so merrily
— — — — — — — — — — — — — — — — — — — — —
the author:
if the Chen “source: CSDN
the original: https://blog.csdn.net/sunny_xsc1994/article/details/44301841

Using glut in CodeBlocks

GLUT is an acronym for OpenGL Utility Toolkit, which is a toolkit that can be used to write OpenGL programs. GLUT is great for learning OpenGL, but it’s not good for developing relatively complex user interfaces. Today I’ll talk about how GLUT is used in Codeblocks.

This topic has been are discussed in both English and Chinese, English version see http://www.sci.brooklyn.cuny.edu/~goetz/codeblocks/glut/, Chinese see “using glut in CodeBlocks (opengl) for Windows”.

Here, paraphrase it again.

Let’s first look at the output of an example program called GLUT.

First, you need to prepare three files, glut32.dll, glut32.lib, Glut.h.
These three files can be downloaded from the Internet. GLUT32 is a dynamically linked library,.h is required at compile time,.lib records the basic information of the library function, and.dll is the implementation of the specific function, which needs to be dynamically loaded when the program runs.
Copy glut32.dll to c:\ Windows /system.
Copy glut32.lib to C :\ Program Files (x86)\codeblocks\mingw\lib.
Copy Glut. h to C :\program files\codeblocks\mingw\include\GL.

Now open Codeblocks, create a new project, and select GLUT Project.

Give the project a name, and then the next step is to specify the location of the GLUT toolkit.

Now that the project is set up, click Compile and run it. It turns out that there are a lot of errors.
To make it work, add the header #include “Windows.h” to the automatically generated main.cpp file, and then compile and run it, and the resulting window will appear. The graphical device interface function is included in Windows.h.

Reproduced in: https://blog.51cto.com/11190017/1762229