Opened 3 years ago

Closed 19 months ago

#49 closed defect (fixed)

windows zlib1.dll error entrypoint missing

Reported by: HoraK-FDF Owned by: PulkoMandy
Priority: major Milestone: 2.6
Component: GrafX2 Version: 2.5
Keywords: Cc:

Description (last modified by pulkomandy)

Hi,

i have just compiled GrafX2 from svn rev. 2171 with mingw32 but the following error occurred when starting grafx2.exe:
(i hope i translated it right at least the sense should be the same)

title:
grafx2.exe - entrypoint not found
message:
The procedureentrypoint "inflateReset2" could not found in the DLL "zlib1.dll"

i resolved the problem by loading the latest zlib1.dll(v1.28) from its official page and overwriting the old one. So the currently included dll on svn must be also replaced i think.

there where also many warnings while compiling should i attach them?

Attachments (1)

makeit.out (8.5 KB) - added by HoraK-FDF 3 years ago.
grafx2 warnings mingw32

Download all attachments as: .zip

Change History (10)

comment:1 Changed 3 years ago by yrizoud

Updating libraries is an endless race, IMO. This version of zlib1.dll may break libpng, which would need us to find an upgrade-friendly version, then it's SDL_Image which won't like the upgrade, etc....
If you go through the hassle, please, please, document what you're using - not only the version numbers, but the URLs or filenames of the things you had to download, and even HOW you managed to compile things when they don't work immediately, like I did in COMPILING.txt. (Many libraries don't compile/install out of the box for Mingw/MSYS)

*many* warnings mean you may have a very different of GCC from me. Can you please post/attach the compilation output, I'd like to have a look. However I can't promise to be fast, I don't have a home PC at the moment.

comment:2 Changed 3 years ago by HoraK-FDF

i have got the dll from here http://zlib.net/zlib128-dll.zip

and here are other things i had to make to get it run.

for sdl i have got it from here
https://www.libsdl.org/download-1.2.php
and there i used this to get the sdl working
https://www.libsdl.org/release/SDL-devel-1.2.15-mingw32.tar.gz
but because in the source files of grafx2 every sdlfile is called directly like #include <SDL.h> i got errors there are two ways to fix that, first quick and dirty copy all from mingw/include/SDL to mingw/include, thats not very nice but it works, i think you should consider to change the grafx2 sources to the layout of sdl so including a file from sdl would simply look like #include <SDL/SDL.h> in that way it is possible to have SDL2 installed at the same time sdl2 simply makes it this way #include <SDL2/SDL.h>

for sdl_image i have got it from here
https://www.libsdl.org/projects/SDL_image/release-1.2.html
there i have downloaded this
https://www.libsdl.org/projects/SDL_image/release/SDL_image-devel-1.2.12-VC.zip
this file includes an SDL_image.lib i had to copy this file to mingw/lib/libSDL_image.a and the SDL_image.h that i copied to mingw/include (if SDL is in the form included like #include <SDL/SDL.h> it must copied to mingw/include/SDL). I don't know if this maybe cause errors somewhere because this lib is for VC the only other way would be to compile it from the file https://www.libsdl.org/projects/SDL_image/release/SDL_image-1.2.12.zip

for sdl_ttf i have got it from here
https://www.libsdl.org/projects/SDL_ttf/release-1.2.html
there i have downloaded this
https://www.libsdl.org/projects/SDL_ttf/release/SDL_ttf-devel-2.0.11-VC.zip
this file includes an SDL_image.lib i had to copy this file to mingw/lib/libSDL_image.a and the SDL_image.h that i copied to mingw/include (if SDL is in the form included like #include <SDL/SDL.h> it must copied to mingw/include/SDL). I don't know if this maybe cause errors somewhere because this lib is for VC the only other way would be to compile it from the file https://www.libsdl.org/projects/SDL_ttf/release/SDL_ttf-2.0.11.zip

for libpng i downloaded it from here
https://sourceforge.net/projects/libpng/files/libpng16/1.6.26/
and there the file
https://sourceforge.net/projects/libpng/files/libpng16/1.6.26/lpng1626.7z/download
First i simply entered make witch produces a shared library but that causes the final linking of grafx2 to fail so make static must be entered. then i have copyied the folders include+lib to the mingw directory.

for freetype i have got it from here:
http://gnuwin32.sourceforge.net/packages/freetype.htm
and there i used the:
http://gnuwin32.sourceforge.net/downlinks/freetype-bin-zip.php
the freetype.lib inside i renamed it to libfreetype.a and copied along with the libfreetype.dll.a to mingw/lib and the include folder to mingw. This archive also contains an freetype-bcc.lib but thats in total different format than VC+mingw

for lua i have taken:
https://www.lua.org/ftp/lua-5.3.3.tar.gz
on the wiki page there stands liblua5.1 but because i already used lua52 commands with the 2.5wip so i thought that is ok i have testet some of my scripts and they have worked. in the src directory i have typed make mingw after that i have changed the lua53.dll to liblua.dll.a and copied it along with the liblua.a to mingw/lib. I copied all .h files in the src directory to mingw/include

currently i'm trying to compile all that libraries that came as *.lib files from their sources with mingw but there are so many dependencies and errors that will take some time.

i append the compiling output right after that comment

btw i just throw this here because i thought a whole ticket for that is overkill maybe. In the gfx2def.ini and so in the gfx2.ini aswell there is a small typo:

  ; -3:Stretch by x3 maximum          | -3:Etire au triple de taille si possible  
  ; -4:Stretch by x4 maximum          | -3:Etire au quadruple de taille si
                                        /\
                                       this

Changed 3 years ago by HoraK-FDF

Attachment: makeit.out added

grafx2 warnings mingw32

comment:3 Changed 3 years ago by pulkomandy

Description: modified (diff)

#include <SDL.h> is the right way to do thing. If you don't believe us, read the FAQ on SDL website. The sdl-config script (which is run by the makefile) will add the proper -I options to the compiler command lines for it to work.

comment:4 Changed 3 years ago by HoraK-FDF

ok i found out why this happened.
in the sdl-config script there is a entry prefix= witch was set in my case to f:/MinGW so it could not find anything, after setting it to c:/MinGW all worked fine.

so that must be checked if sdl is installed to another folder other than the final. I had done this because i had not much room on c: and did not know how much it will take, now after knowing how much it is, i could have installed it directly there. Than all is fine with the #include <SDL.h> but its kind of strange to me because in that way i could not have installed sdl2 at the same time and use it an a program that need to switch between sdl/sdl2 for whatever reason (backward compatibility maybe)

comment:5 Changed 3 years ago by pulkomandy

Description: modified (diff)

It is not possible to mix SDL1 and SDL2 in the same program. They have conflicting function names and many other problems. SDL2 comes with sdl2-connfig which sets its own include paths as it needs.

This is common also for other projects, sometimes using the generic pkg-config system. GrafX2 makefiles will use that to detect Lua, for example.

comment:6 Changed 2 years ago by Thomas Bernard

I think we can mark this bug as resolved.
One can easily recompile the 3rd party libraries :

$ cd 3rdparty
$ make

(or $ WIN32CROSS=1 make ;)

comment:7 Changed 2 years ago by PulkoMandy

Milestone: 2.52.6

comment:8 Changed 2 years ago by PulkoMandy

Owner: changed from pulkomandy to PulkoMandy
Status: newassigned

comment:9 Changed 19 months ago by Thomas Bernard

Resolution: fixed
Status: assignedclosed
Note: See TracTickets for help on using tickets.