Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GTK+3 application won't run on Windows #3794

Closed
liudonghua123 opened this issue May 22, 2018 · 9 comments
Closed

GTK+3 application won't run on Windows #3794

liudonghua123 opened this issue May 22, 2018 · 9 comments

Comments

@liudonghua123
Copy link

When I try the example-0.c on https://developer.gnome.org/gtk3/stable/gtk-getting-started.html, I can build successfully in my cmd (I have configured the PATH environment variable), but run with the errors as the snapshot below.

image
image

Also note if I didn't close the first error msgbox quickly, the second error msgbox won't shown. This is really strange.

However, I can run it (./example-0.exe) without this problem in my C:\msys32\mingw32.exe

image

@liudonghua123
Copy link
Author

My PATH environment variable is as below.

image

@TheDcoder
Copy link

I am essentially having the same issue but it won't work even from the MINGW shell. I am also getting 2 errors but they are a bit different:

The procedure entry point deflateSetHeader could not be located in the dynamic link library C:\msys64\mingw64\bin\libgio-2.0-0.dll. 

and

The procedure entry point inflateReset2 could not be located in the dynamic link library C:\msys64\mingw64\bin\libpng16-16.dll. 

@liudonghua123
Copy link
Author

liudonghua123 commented May 24, 2018

@TheDcoder Did you installed the packages list on https://gtk.org/download/windows.php ?

I also asked this question on StackOverflow.

@TheDcoder
Copy link

TheDcoder commented May 24, 2018 via email

@tschoonj
Copy link
Contributor

@TheDcoder I bet you have two zlib1.dll's on your system. What is the output on your MSYS2 shell for:

which zlib1.dll

@TheDcoder
Copy link

TheDcoder commented May 25, 2018

@tschoonj You were right! Albeit which zlib1.dll did not find any files because my shell doesn't have them in path (I lauch the executable externally). where zlib1.dll in command prompt did show two files:

C:\Users\TheDcoder>where zlib1.dll
C:\Program Files\Intel\WiFi\bin\zlib1.dll
C:\msys64\mingw64\bin\zlib1.dll

The rouge zlib1.dll from Intel was the problem, after I renamed it my executable worked perfectly!

It was tricky, but thanks!

@liudonghua123
Copy link
Author

@tschoonj Thanks, you get the point, it's the zlib1.dll priority problem.
image

@LRN
Copy link

LRN commented May 26, 2018

It is very unhealthy to put random things into PATH.

I would suggest either adjusting the installation instructions to mention this problem, or adding this to the List Of Most Common Issues, or writing a tool that would run in post-install step of any package and check for exe and dll files in PATH shadowing the exe and dll files in mingw bin subdirectory.

@TheDcoder
Copy link

@LRN While it is true that it is not a good practice to add random things to PATH, most additions cannot be helped as they are performed by installers of other programs on the computer. And if you are you developer who deals with C you should know what to put in your PATH anyway 😄

During deployment, I prefer to place all the required DLLs in the same folder as my executable so that they take priority over items in PATH.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants