user5473227
user5473227

Reputation:

windows cant find dll even thought its in a directory in the PATH

I have cpp file called funner.cpp which i compiled down to a dll file by using the following command: (using microsofts CL compiler, btw)

   cl /LD funner.cpp

that generated the following files: funner.lib, funner.dll.

i then created another cpp file called mainer.cpp which calls a function within the dll.

i compiled that file using this command:

   cl mainer.cpp /link funner.lib

that, then, generated an executable file, called mainer.exe.

When i run mainer.exe the program runs as expected and i get no errors what so ever. (as long as the funner.dll file is in the same directory)

however i would like to move the funner.dll to another directory somewhere else, say:

   c:\my_dlls\

so i did that and then i added the folder to my system PATH variable.

i then tried running the executable but it threw me an error saying that the dll was missing?

but doesn't windows search all the directories in the PATH variable for dlls ?

why cant it find my dll?

Upvotes: 3

Views: 3886

Answers (1)

Zinki
Zinki

Reputation: 446

The command line does not receive the updated PATH until you close and reopen it.

Open a new command line and call the executable from there.

Upvotes: 2

Related Questions