MSYS2 0.9.3 - dll Entry Point issues on examples, but PATH variable seems correct

Hi,
Having installed MSYS and compiled OF and some examples without error, I get dll entry point errors on running the examples.

Here are the error messages.

the procedure entry point _ZNKSt7__cxx112basic_stringlcSt11char_traitslcESalcEE4sizeEV could not be located in the dynamic link library c:\msys64\mingw32\bin\libboost_system-mt.dll

and another

the procedure entry point _ZNKSt76locale4nameB5cxx11EV could not be located in the dynamic link library [...]\3dPrimitivesExample\bin\3DPrimitivesExample.exe

To summarise updates below:

  • PATH variable is correct, and I’ve tried with msys paths at end and beginning of string
  • Other MSYS users are finding the same problem on 0.9.3
  • I have confirmed I am compiling and running in mingw32 console

Just to clear a few other potential issues - double checked my PATH variable - it contains c:\msys64\mingw32\bin;c:\msys64\usr\bin;

double checked running in mingw32 console - I am

And the behaviour detailed above is repeated for every example I try to compile and run

I’ve found a similar problem for other users on 0.9.3 with both win10 and win 7 here

https://forum.openframeworks.cc/t/build-ok-but-entry-point-not-found-error-dll/22829/2

Those users state that like me they have PATH variable set up correctly, but resolved by copying required DLLs to the directory (which isn’t a sustainable solution) Any ideas on resolution? Presumably something in the 0.9.3 MSYS build isn’t interacting with the PATH variables correctly?

I’ve now tried with the msys64 paths at the beginning and the end of the PATH variable - no difference either way

It’s actually not that bad. Some dlls will always be copied anyway, in particular those located in the ‘export’ folder. To avoid copying missing dlls manually all the time, there’s a hack I found:
Just throw the missing dlls into the ‘export’ folder and then modify the script ofApp.qbs in libs/openFrameworks/Compiled/projects/qtcreator. You’ll see following line:

Artifact {
            filePath: "bin/fmodex.dll"
            fileTags: "processed_file"
        }

and later on:

        File.copy(FileInfo.joinPaths(exportDir,"fmodex.dll"), project.path+"/bin/fmodex.dll");

These two lines are responsible for copying fmodex.dll from ‘export’ to your project bin by default. Now you can do the same thing for those missing dlls you put into ‘export’. Just duplicate the code and replace the name of the dll.

Think so too. Maybe this issue gets resolved in a future release.

1 Like

Thanks, I’ll give that a go.
Increasingly thinking of just biting the bullet and getting used to VS though.

Also - I think this is an MSYS2 rather than oF issue though. I’ve had similar issues today compiling straight C++ with nothing more than a few standard libraries.

Tell if it works for you. By the way, are you compiling via command line or with QT creator? Have you tried both and are the issues the same?

Now I have tried both and it’s same for me. It’s grotesque, I checked the dependencies of my .exe with Dependecy Walker and here’s the thing:
I’m only missing libstdc+±6.dll. The dll exists inside msys64/mingw32/bin. Now if I copy exactly this dll (manually or by modifying ofApp.qbs) into the project bin, I got no problem running the app. DW shows me that my .exe finds the .dll it in the project bin.
If I, however, don’t copy this .dll, my app won’t run because it assumingly can’t find the .dll. But checking with DW shows me, that the .exe correctly looks for (and finds?) the .dll in msys64/mingw32/bin - just where it is and should be.
I’m utterly confused by what’s going on.
Also, I have kind of the same problems with running compiled QT examples (those you find in the “welcome” tab). These are not build with msys2 but with the default kit. Again, my .exe won’t find necessary .dlls which are clearly located at the given path and manually copying solves the issue.
So I guess it’s rather a Qt issue. I might try reinstall Qt. I can, however, remember that I could compile and run the Qt examples without these issues on another machine (both Win 7).

Ok, I added the QT bin to the PATH manually and now it’s only the libstdc+±6.dll which still can’t be found (although it should) and which has to be copied to the project bin. So I turns out to be the same issue as with the OF examples.

Could you try to nail down which dlls are missing for you? Let’s see if we both actually have the same issue.

Thanks for all the detail on this. I’ll not have time to look today, but I’ll try to find time tomorrow night and get back to you.

OK, I’m curious!

After some digging I’m pretty sure my problem is conflicting versions of libstdc+±6.dll which can’t be resolved via the PATH variable. Windows DLL HELL :-D. Here’s some interesting discussion:

http://mingw-users.1079350.n2.nabble.com/Conflicting-libstdc-6-dll-requirements-and-licensing-td6160814.html

Some suggested that libstdc+±6.dll had been traditionally linked statically, even for dynamically linked builds. So this might be the sanest way to get rid of any conflicts (just have to find out how to do that in QT creator), although copying into the project bin seems to do the job just as good.

I just had this problem. I solved it by placing the mingw path at the beginning of the path variable as suggested here:

so basically put mingw at the very beginning of the variable.