Unable to load DLL 'freeglut.dll': The specified module could not be found

Yairk_kaufmann 6 Reputation points
2021-05-17T12:41:43.56+00:00

I have a window form application (.net) .net 4.7.2 and I have a folder called dlls and it includes the files:
freeglut.dll,
ImageSharp.dll,
OpenGL.deps.json,
OpenGL.dll,
OpenGL.pdb,
OpenGL.xml,
Tao.FreeGlut.dll,
Tao.FreeGlut.dll.config,
Tao.OpenGl.dll
And added tao.opengl.dll and tao.freeglut for references and also added ShadowEngin.dll from another folder

And this is my code:

Using a system;
Using System.Collections.Generic;
Using System.ComponentModel;
Using System.Data;
Using System.Drawing;
Using System.Text;
Using System.Windows.Forms;
Using Tao.OpenGl;
Using ShadowEngine;
Using ShadowEngine.OpenGL;
Using ShadowEngine.Sound;
Using Tao.FreeGlut;
Open namespace
{
    Public Partial Department Form 1: Form
    {


        Public Form 1 ()
        {
            Glut.glutInit ();

        }
        Disable Form1_Load Details (Submitter Object, EventArgs e)
        {

        }
        Empty blank panel 1_Paint (Object sender, PaintEventArgs e)
        {
        }
        1_Click Private Space Button (Object Sender, EventArgs e)
        {

        }
        Cancel CreateCollisions ()
        {

        }
    }
}

And I get the error "Unable to load DLL 'freeglut.dll': The specified module could not be found"

Developer technologies | Windows Forms
Developer technologies | C#
{count} votes

1 answer

Sort by: Most helpful
  1. Daniel Zhang-MSFT 9,656 Reputation points
    2021-05-18T01:40:39.023+00:00

    Hi YRK-33345,
    Application will often load .DLL files from the application folder first. If it does not find the .DLL file here, it will automatically check the Windows system folders.
    First, please try to place the .DLL file in the same folder where the application .exe file is located.
    You can also install .DLL files directly to Windows.

    1. Copy the .DLL file to your C:\Windows\System32\ folder. (32 bit)
    2. Copy the .DLL file to your C:\Windows\SysWOW64\ folder. (64 bit)
    3. DLL installation has been completed.
      Here is a similar thread you can refer to.
      Best Regards,
      Daniel Zhang

    If the response is helpful, please click "Accept Answer" and upvote it.

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    1 person found this answer helpful.

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.