0

I have a C++ program that uses the freeglut library (and hence requires the freeglut.dll at run-time. I have added the folder C:\Program Files\Common Files\freeglut\bin to my PATH environment variable.

To confirm that the location is correct, when I compile my program (debug build) and run the resulting .exe file, it works fine (the freeglut.dll file is not in the same directory as the executable).

However, when I run the program directly from the VS2012 debugger, I get this message:

The program can't start because freeglut.dll is missing from your computer. Try reinstalling the program to fix this problem.

I know that one solution is to place the freeglut.dll file in the directory of the executable. This is what I've been doing so far, but I would much rather simply inform VS2012 (or my program) of where to find the dll file. Note that this post also seems loosely related, but it doesn't seem to contain an answer relevant to what I am trying to achieve (I just want the debugger to look in the same place for DLLs as any other program!).

How do I achieve this in VS2012? Icing on the question cake would be an explanation as to why the debugger doesn't just look in the PATH variable like any other program...

Community
  • 1
  • 1
quant
  • 21,507
  • 32
  • 115
  • 211

2 Answers2

1

You can also set project based Environment:

  1. Open project Properties
  2. Go to Configuration Properites -> Debugging
  3. Enter the path in Environment, eg:

    PATH=$(PATH);C:\Program Files\Common Files\freeglut\bin
    
fxam
  • 3,874
  • 1
  • 22
  • 32
0

Restart Visual Studio after modifying your PATH variable.

What I did actually worked. I just didn't restart VS...

quant
  • 21,507
  • 32
  • 115
  • 211