ddobrev / QtSharp

Mono/.NET bindings for Qt
Other
571 stars 51 forks source link

Dll not found errors #39

Closed Hecatron closed 8 years ago

Hecatron commented 8 years ago

With the latest releases that use Qt 5.5.1, I've not been able to test the latest fixes (I really want to see it working)

For some reason I've been getting "System.DllNotFoundException' occurred in QtWidgetsSharp.dll" {"Unable to load DLL 'Qt5Widgets': The specified procedure could not be found. (Exception from HRESULT: 0x8007007F)"} When trying to create the QApplication object, or trying to create a new QWidget object

I've now got Qt 5.5.1 installed, my system path looks fine for the dll directories (putting C:\Qt\Qt5.5.1\5.5\mingw492_32\bin into the path is the main one) I even tried just dumping the Qt5 dll's directly into the application's debug directory in case it couldn't find them for some reason. I checked the dll types are all 32bit

Still trying to figure out if it's something to do with my Qt install (using Mingw 32bit) or something else I think I'll try re-installing Qt, then recompiling everything from source including Cppsharp just to see if that fixes it

ddobrev commented 8 years ago

I am afraid I have no idea. The release contains everything as usual: the wrappers and the native inlines. You could use the excellent http://www.dependencywalker.com/ to check what the problem is. Just load your executable in the program and it will show you any missing dependencies.

ddobrev commented 8 years ago

Have you been able to fix it?

Hecatron commented 8 years ago

Not yet, I did use dependency walker but didn't get very far I think it may be something to do with x32 / x64

ddobrev commented 8 years ago

Any chance you have copied Qt libs along with your exe? If so, they would take precedence over your PATH and if they remained from Qt 5.5.0, it might explain the error.

ddobrev commented 8 years ago

Your previous executable was built with x86 because otherwise it would've crashed too. So you could check if you have accidentally switched the build configuration to AnyCPU.

Hecatron commented 8 years ago

already checked those things, build config is x86 not Any CPU, and there's no old QT libs in the application directory. I've just removed all old versions of Qt on the system (although that shouldn't make a difference because the paths are only for the latest version) and I'm re-installing 5.5.1

If that doesn't work I'm going to try to build from source and figure it out from there

Hecatron commented 8 years ago

nailed it, it's something to do with my system path. I think one of the later path additions is some how messing up the finding of the Qt directory.

Hecatron commented 8 years ago

closing this one down since its my fault on this one, I just need to figure out which part of my path is being messed up. I managed to get it working by manully specifying the path in a command prompt

The loading of ui files is pretty cool that seems to work okay