Open se5a opened 5 years ago
You need to use a more recent libpng. I got past this error by using libpng16-16
on Ubuntu Xenial.
Ah right, I'll give that a shot. Checking dependencies was on my list of things to try but I figured someone else would have the same problem so I figured I might as well create an issue for someone else to find. Quick reply, thanks. ;)
Still getting the same error with libpng16-16 version (1.6.20-2).
@se5a Are you sure that you are really using that freshly downloaded libpng version now? The issue has been fixed in libpng 1.6 and occured due to version 1.2 assuming sizeof(unsigned long int)==4, which is not true on Linux x86_64[1].
The makefile used in the compilation process uses GCC to determine the location of the required dependencies[2]:
@cp "$$(realpath $$(gcc $(ARCHFLAGS) $(LDFLAGS) --print-file-name=$@))" "$(BINDIR)/$@"
Make sure you don't have multiple libpng versions and try to manually execute this command and make sure you actually get the expected result.
[1]: https://bugs.launchpad.net/ubuntu/+source/libpng/+bug/1348144 [2]: https://github.com/BlindMindStudios/StarRuler2-Source/blob/master/source/linux/Makefile#L335
looks like I have libpng12 installed as well, and apt-get remove wont uninstall it due to unmet dependencies. not sure what command I'm supposed to be manually executing there and what the result I should be expecting is.
@se5a You can try pointing your makefile to the full path of libpng 1.6 here:
https://github.com/BlindMindStudios/StarRuler2-Source/blob/master/source/linux/Makefile#L144
COPY_LIBS += libpng.so
becomes
COPY_LIBS += your/path/to/libpng.1.6.so
Should work, as thats exactly what they have done with darwin OS some lines above that.
@Xatenev I tried your suggestion to no avail. Any other ideas?
Worth noting that the COPY_LIBS behavior is disabled in the Makefile. We used it for storing the library versions that the binary was linked against for commercial packages, but it's not needed when compiling on the system that will be running the binary, and the Makefile currently uses system libraries instead.
I'm not sure how your distro handles multiple versions of libpng, but it seems that the system's
ah. so that'll be why putting nonsense in the COPY_LIBS line didn't even make a difference. (couldn't figure out whether the filename should have been libpng.1.6.so or libpng16.so.16.20.0 or libpng16.so.16 or if I was barking up the wrong tree completely, and it seemed to give the same output whatever I put)
I'm using linux Mint which can be pretty much be treated as Ubuntu. (guess I should have mentioned that in the first post)
so now I'm getting well out of my depth, build problems are the main reason I never got around to learning cpp... how do I figure out what header file to include in the image.cpp and what linker flag to use in the makefile?
What solved this error for me was installing libpng16-dev and libpng16-devtools. Give that a try and see if it works for you
Bingo!
Maybe if the readme had a list of dependencies by name as required by apt-get it would help.
@se5a That would be a great idea. Can you write a pull request for the Readme with the Libraries you needed on Ubuntu?
Well that's the thing, I don't know.
did I need libpng16-16 or libpng16-dev or libpng16-devtools or did I need all three? or two? or what?
and now I'm getting: make: *** No rule to make target '/usr/include/freetype2/freetype/freetype.h', needed by 'obj/lin64/render/font_ft2.o'. Stop.
is this an unmet freetype dependancy or something else?
I do not know about the free type error you get, but I will look tonight which libraries I have installed on Archlinux because at my end it compiled without any issue. Maybe it helps you narrow down which packages are needed on Ubuntu.
I'm glad it worked for you! I myself am trying to figure out how to fix the freetype2 error. I can say that downloading and installing freetype2 from the developer's website doesn't work.
How did you guys install libpng16 without breaking freetype? On Ubuntu 16.04 this depends on libpng12. According to other game devs it should be possible to install both, except Ubuntu doesn't like it.
not sure, I apt-get installed libpng16-16 libpng16-dev libpng16-devtools first, then the freetype ones you pointed out. not sure if order makes any difference...