Missing .dll file on executing compiled windows app

#1

Hello all

I have an app that I’m compiling for both Mac and Windows. On the windows compile, I’ve learnt that I need to include a series of dll files in order for the .exe file to run. I include these in the /bin folder by simply copying them across.

For what seems like the majority of windows users, this works fine - the .exe file runs no problem. But, with one or two users, they get a persistent message reading *‘The code execution could not proceed because ***.dll was not found. Reinstalling the program may fix this problem’

Does anyone know why this is happening and how we might fix it?

In hope
Sam

#2

Installing c++ redistributable

#3

Hello,

If you are compiling with MSYS2, you may try
make copy_dlls

That will copy the needed mingw32 dlls into your bin folder.

#4

Hi there, thanks for the responses

I’m compiling in VS 2017, and copying the required dll files across into the bin folder manually. It is the same dll files that are being named in the error message: fmodex64, fmodexL64, FreeImage, and libiconv.dll (the last one is the one that is called in the current message, but in the past others have been too).

We’ve tried installing c++ redistributable but it didn’t fix the issue.

S

#5

It depends whether you’re building your OF app in Visual Studio or QtCreator/MSYS2…
Compiled Visual Studio project supposedly depends on vc++ redistributable.

I personally find Mingw32 more versatile and open alternative (without need to install vc++ redist and it was here since the first OF releases on Code::Blocks), but I’m afraid the only solution is to manually copy all the DLLs that it actually requires…

Tried to compile it with make copy_dlls as suggested by @oxillo, and it didn’t work somehow… Got no dlls copied to the folder with the executable. But once you copy all the dlls it asks for, it should stop asking for more stuff and run it properly. (Not sure if having Msys2 installed in the system makes a difference or not though…)

#6

There is a bug in OF0.10.1 where it tries to get debug version of the generated executable.

You may rename your app from myApp.exe to myApp_debug.exe, run ‘make copy_dlls’ and rename back to myApp.exe.

You may also edit \libs\openFrameworksCompiled\project\msys2\config.msys2.default.mk to have

ifneq ("$(wildcard $(PLATFORM_PROJECT_RELEASE_TARGET))","")
	PLATFORM_PROJECT_EXISTING_TARGET=$(PLATFORM_PROJECT_DEBUG_TARGET)
else
	PLATFORM_PROJECT_EXISTING_TARGET=$(PLATFORM_PROJECT_RELEASE_TARGET)
endif
#7

Thanks @oxillo. Just tested and yeah, it worked. I propose your response as a solution.

#8

Hi,

Sorry but I don’t see how the above three replies answer my original query. They seem like a tangental issue, i.e how to auto copy the .dll files

  • I am compiling on visual studio, not mysys2
  • I already have all the dll files required to run the exe copied to the bin file I am sharing with others
  • I know the compile works because it works on most other windows machines
  • On some machines I get a '.dll was not found’ message on attempting to run the exe file

What would cause the above, and how do I fix it?

#9

Have you tried installing vc++ redistributables AND having all the dlls in the folder with the .exe?

#10

Yup

The following .dlls automatically copy into the bin folder:

  • fmodex64.dll
  • fmodexL64.dll
  • Freeimage.dll

The libiconv.dll does not copy automatically and I have to find and copy it in manually.

Mostly the compiled exe works fine, but on some machines the .dll not found message appears on attempting to run.

#11

Might this be a PC security software clash? Some protection system preventing the dlls from being found/run?

I’m at a bit of a loss in terms of finding a fix