markusfisch / PieDock

A dock but in shape of a pie menu
http://markusfisch.de/PieDock
MIT License
19 stars 7 forks source link

PieDock 1.6.1 fails to compile against libpng 1.6, trivial fix #6

Closed ssuominengentoo closed 10 years ago

ssuominengentoo commented 11 years ago

png.h in libpng 1.6.* no longer pulls in string.h implicitly so you have to explicitely include string.h when you need it

therefore add string.h to include for memset() in src/IconMap.cpp and string.h to include for memcpy() in src/Png.cpp

original bug was filed at Gentoo, here https://bugs.gentoo.org/show_bug.cgi?id=471460

ssuominengentoo commented 11 years ago

Direct link to the patch

http://sources.gentoo.org/viewvc.cgi/gentoo-x86/x11-misc/piedock/files/piedock-1.6.1-mem.patch?rev=1.1&view=markup

livibetter commented 10 years ago

I am trying out 1.6.3 from tarball and still getting the same errors:

$ make
Making all in src
make[1]: Entering directory `/tmp/piedock-1.6.3/src'
g++ -DPACKAGE_NAME=\"\" -DPACKAGE_TARNAME=\"\" -DPACKAGE_VERSION=\"\" -DPACKAGE_STRING=\"\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -DPACKAGE=\"PieDock\" -DVERSION=\"1.6.3\" -DHAVE_LIBX11=1 -DHAVE_LIBPNG=1 -DHAVE_LIBZ=1 -DHAVE_XFT=1 -DHAVE_XRENDER=1 -DHAVE_XMU=1 -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_STDINT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_SYS_SOCKET_H=1 -DHAVE_UNISTD_H=1 -DHAVE_STDBOOL_H=1 -DHAVE_FORK=1 -DHAVE_VFORK=1 -DHAVE_WORKING_VFORK=1 -DHAVE_WORKING_FORK=1 -DHAVE_STDLIB_H=1 -DHAVE_MALLOC=1 -DHAVE_BZERO=1 -DHAVE_FLOOR=1 -DHAVE_MEMSET=1 -DHAVE_POW=1 -DHAVE_SELECT=1 -DHAVE_SOCKET=1 -DHAVE_SQRT=1 -DHAVE_STRCASECMP=1 -DHAVE_STRCSPN=1 -DHAVE_STRDUP=1 -DHAVE_STRERROR=1 -DHAVE_STRSTR=1 -I.     -g -O2 -I/usr/include/freetype2 -MT Png.o -MD -MP -MF .deps/Png.Tpo -c -o Png.o Png.cpp
Png.cpp: In static member function 'static PieDock::ArgbSurface* PieDock::Png::load(std::istream&)':
Png.cpp:92:27: error: 'memcpy' was not declared in this scope
make[1]: *** [Png.o] Error 1
make[1]: Leaving directory `/tmp/piedock-1.6.3/src'
make: *** [all-recursive] Error 1

So, I followed Gentoo's newer patch and appended .h, PieDock compiled and it runs.

I don't know anything about C++ or the building, is this because g++ or too different between Gentoo and @markusfisch's system?

My GCC:

$ g++ --version
g++ (Gentoo 4.7.3-r1 p1.3, pie-0.5.5) 4.7.3
Copyright (C) 2012 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
ssuominengentoo commented 10 years ago

It's because png.h in libpng16 no longer includes string.h and because PieDock using functions from string.h like memcpy() but never include string.h for them It's true that some older compilers and also, older or different libc's might accidentally indireclty pull in string.h through some header which makes PieDock accidentally compile, but that's just sheer luck Point is: If you use a function from a header, make sure to #include the header, or the function you are using might not be there, and likely won't be

No clue why this still hasn't been fixed... libpng16 has been the stable version fo, what, half an year about now? So half an year of non-compileness without manual patching.

markusfisch commented 10 years ago

Ok, I got it. Actually I thought I fixed this 9 month ago by including "string" and thinking it would also include "string.h". Shame on me.

Latest version is 1.6.4 now.