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

Unable to setup: NO PNG HEADERS FOUND, you need to install libpng-dev #34

Closed
canpoyrazoglu opened this issue Nov 20, 2018 · 3 comments
Closed

Comments

@canpoyrazoglu
Copy link

I'm on a fresh Ubuntu 18.10 installation (just installed on a fresh VM).

When I try to build using "./setup.py build" I get the following error:

can@ubuntu:~/Desktop/gnofract4d$ ./setup.py build
Can't find 'libpng'
Some functionality will be disabled
Traceback (most recent call last):
  File "./setup.py", line 53, in <module>
    raise Exception("NO PNG HEADERS FOUND, you need to install libpng-dev")
Exception: NO PNG HEADERS FOUND, you need to install libpng-dev

I've installed libpng:

can@ubuntu:~/Desktop/gnofract4d$ sudo apt-get install libpng-dev
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following additional packages will be installed:
  libpng-tools
The following NEW packages will be installed:
  libpng-dev libpng-tools
0 upgraded, 2 newly installed, 0 to remove and 21 not upgraded.
Need to get 202 kB of archives.
After this operation, 703 kB of additional disk space will be used.
Do you want to continue? [Y/n] 
Get:1 http://us.archive.ubuntu.com/ubuntu cosmic/main amd64 libpng-dev amd64 1.6.34-2 [177 kB]
Get:2 http://us.archive.ubuntu.com/ubuntu cosmic/main amd64 libpng-tools amd64 1.6.34-2 [25.6 kB]
Fetched 202 kB in 1s (169 kB/s)         
Selecting previously unselected package libpng-dev:amd64.
(Reading database ... 171360 files and directories currently installed.)
Preparing to unpack .../libpng-dev_1.6.34-2_amd64.deb ...
Unpacking libpng-dev:amd64 (1.6.34-2) ...
Selecting previously unselected package libpng-tools.
Preparing to unpack .../libpng-tools_1.6.34-2_amd64.deb ...
Unpacking libpng-tools (1.6.34-2) ...
Setting up libpng-tools (1.6.34-2) ...
Processing triggers for man-db (2.8.4-2) ...
Setting up libpng-dev:amd64 (1.6.34-2) ...


However, I'm still getting the exact same error about not finding libpng. What am I doing wrong? Why can't it find libpng after installing and why can't it build properly as readme clearly states that libpng is optional anyway?

@canpoyrazoglu
Copy link
Author

Okay, I've solved the problem by digging into the setup script, but there are multiple issues here about incorrect documentation that needs to be corrected:

Querying about libpng and libjpeg was using pkg-config command. pkg-config was not installed in fresh Ubuntu installation, so it was failing, and thinking that libpng was not installed. The stack trace doesn't mention anything about pkg-config, nor does documentation. I've installed pkg-config

sudo apt install pkg-config

That problem went away, but I still got an error:

fract4d/c/fract4dmodule.cpp:14:10: fatal error: Python.h: No such file or directory #include "Python.h"

That one was easy, I needed to install Python 3 developer tools (though someone inexperienced might have trouble finding the cause):

sudo apt-get install python3-dev

Then, that problem went away too.
I tried to build again, then I got an error about libjpeg not being present. I've installed that too and problem went away and I could run Gnofract4.

To summarize:

  • Readme should state that you need to have pkg-config
  • Readme should state that you need to have python3-dev
  • libpng and libjpeg are currently NOT optional. Readme should either state that they are mandatory, or make them optional.

@edyoung edyoung mentioned this issue Nov 21, 2018
@edyoung
Copy link
Member

edyoung commented Nov 21, 2018

Please see if this PR addresses the issue

@canpoyrazoglu
Copy link
Author

Yes, it addresses the issue clearly now.

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

2 participants