[Solved]Unable to compile libpng (from cegui-dep) on mingw32

For help with general CEGUI usage:
- Questions about the usage of CEGUI and its features, if not explained in the documentation.
- Problems with the CMAKE configuration or problems occuring during the build process/compilation.
- Errors or unexpected behaviour.

Moderators: CEGUI MVP, CEGUI Team

odedsh
Just popping in
Just popping in
Posts: 12
Joined: Thu Nov 14, 2013 18:17

[Solved]Unable to compile libpng (from cegui-dep) on mingw32

Postby odedsh » Thu Nov 14, 2013 18:38

Hi,

I'm new to CEGUI, and I am having problems compiling the library. In fact I'm having trouble compiling the dependencies:

The error I am seeing is this:

Linking C shared library ..\..\..\dependencies\bin\liblibpng.dll
cd /d C:\Cpp\cegui-deps-0.8.x-src\src\libpng-1.4.7\CEGUI-BUILD && "C:\Program Files (x86)\CMake 2.8\bin\cmake.exe" -E cmake_link_script CMakeFiles\libpng.dir\link.txt --verbose=1 "C:\Program Files (x86)\CMake 2.8\bin\cmake.exe" -E remove -f CMakeFiles\libpng.dir/objects.a

C:\MinGW\bin\ar.exe cr CMakeFiles\libpng.dir/objects.a @CMakeFiles\libpng.dir\objects1.rsp

C:\MinGW\bin\gcc.exe ..\scripts\pngwin.def -shared -o ..\..\..\dependencies\bin\liblibpng.dll -Wl,--out-implib,..\..\..\dependencies\lib\dynamic\liblibpng.dll.a -Wl,--major-image-version,0,--minor-image-version,0 -Wl,--whole-archive CMakeFiles\libpng.dir/objects.a -Wl,--no-whole-archive ..\..\..\dependencies\lib\dynamic\libzlib.dll.a -lkernel32 -luser32 -lgdi32 -lwinspool -lshell32 -lole32 -loleaut32 -luuid -lcomdlg32 -ladvapi32

c:/mingw/bin/../lib/gcc/mingw32/4.7.2/../../../../mingw32/bin/ld.exe: ..\scripts\pngwin.def:5: syntax error
c:/mingw/bin/../lib/gcc/mingw32/4.7.2/../../../../mingw32/bin/ld.exe:..\scripts\pngwin.def: file format not recognized;treating as linker script
c:/mingw/bin/../lib/gcc/mingw32/4.7.2/../../../../mingw32/bin/ld.exe:..\scripts\pngwin.def:1: syntax error
collect2.exe: error: ld returned 1 exit status
src\libpng-1.4.7\CEGUI-BUILD\CMakeFiles\libpng.dir\build.make:455: recipe for target 'dependencies/bin/liblibpng.dll' failed
Mingw32-make[2]: *** [dependencies/bin/liblibpng.dll] Error 1
Mingw32-make[2]: Leaving directory 'C:/Cpp/cegui-deps-0.8.x-src'
CMakeFiles\Makefile2:211: recipe for target 'src/libpng-1.4.7/CEGUI-BUILD/CMakeFiles/libpng.dir/all' failed
Mingw32-make[1]: *** [src/libpng-1.4.7/CEGUI-BUILD/CMakeFiles/libpng.dir/all] Error 2
Mingw32-make[1]: Leaving directory 'C:/Cpp/cegui-deps-0.8.x-src'
Makefile:74: recipe for target 'all' failed
Mingw32-make: *** [all] Error 2

I am using gcc 4.7.2 , cmake version 2.8.12

I have never built a DLL with a manual def file before but I believe that the problem is that the def file provided does not work with gcc
;------------------------------------------
; LIBPNG module definition file for Windows
;------------------------------------------

LIBRARY

EXPORTS
;Version 1.4.7
png_build_grayscale_palette
png_chunk_error
png_chunk_warning
...

According to:http://gcc.gnu.org/onlinedocs/gnat_ugn_unw/The-Definition-File.html
after the keyword LIBRARY you should put the name of the Library.

If I use LIBRARY png (instead of LIBRARY) the dll is created..

Does anyone have any experience compiling on windows with Mingw32?
Anyone else has a similar problem?
Any idea if this solution will work?

Thanks
Oded
Last edited by odedsh on Sun Nov 24, 2013 06:36, edited 1 time in total.

odedsh
Just popping in
Just popping in
Posts: 12
Joined: Thu Nov 14, 2013 18:17

Re: Unable to compile libpng (from the cegui-dep) with mingw

Postby odedsh » Thu Nov 14, 2013 18:54

Same issue occurs with libexpat.. (syntax error in libexpat.def)
Same change fixes it there as well

User avatar
Ident
CEGUI Team
Posts: 1998
Joined: Sat Oct 31, 2009 13:57
Location: Austria

Re: Unable to compile libpng (from the cegui-dep) with mingw

Postby Ident » Mon Nov 18, 2013 18:26

Hi,

Can you create us a fix for this and make a pull request? I am not a mingw user so I can't really do anything about this myself but if you provide us something we will try to merge it in.
CrazyEddie: "I don't like GUIs"

odedsh
Just popping in
Just popping in
Posts: 12
Joined: Thu Nov 14, 2013 18:17

Re: Unable to compile libpng (from the cegui-dep) with mingw

Postby odedsh » Sun Nov 24, 2013 06:36

Done

User avatar
Ident
CEGUI Team
Posts: 1998
Joined: Sat Oct 31, 2009 13:57
Location: Austria

Re: [Solved]Unable to compile libpng (from cegui-dep) on min

Postby Ident » Sun Nov 24, 2013 22:23

CrazyEddie: "I don't like GUIs"


User avatar
Ident
CEGUI Team
Posts: 1998
Joined: Sat Oct 31, 2009 13:57
Location: Austria

Re: [Solved]Unable to compile libpng (from cegui-dep) on min

Postby Ident » Mon Nov 25, 2013 13:14

Silly me :oops:

Thanks!
CrazyEddie: "I don't like GUIs"


Return to “Help”

Who is online

Users browsing this forum: No registered users and 7 guests