Carla: Error with `make PythonAPI`

Created on 23 Oct 2018  路  8Comments  路  Source: carla-simulator/carla

I have built Carla from source on Ubuntu 16.04. Whenever I try to run make PythonAPI, I get the following:

In file included from source/libcarla/libcarla.cpp:38:
In file included from source/libcarla/SensorData.cpp:9:
In file included from dependencies/include/carla/image/ImageIO.h:9:
In file included from dependencies/include/carla/image/ImageIOConfig.h:50:
In file included from dependencies/include/boost/gil/extension/io/png_io.hpp:35:
In file included from /usr/include/png.h:321:
/usr/include/pngconf.h:383:12: error: unknown type name '__pngconf'
__pngconf.h__ in libpng already includes setjmp.h;
^
/usr/include/pngconf.h:383:21: error: cannot use dot operator on a type
__pngconf.h__ in libpng already includes setjmp.h;
^
/usr/include/pngconf.h:384:12: error: unknown type name '__dont__'
__dont__ include it again.;
^
/usr/include/pngconf.h:384:28: error: expected ';' after top level declarator
__dont__ include it again.;
^
4 errors generated.
error: command 'clang-5.0' failed with exit status 1
Util/BuildTools/Linux.mk:47: recipe for target 'PythonAPI' failed
make: * [PythonAPI] Error 1

EDIT: Setting -DLIBCARLA_IMAGE_WITH_PNG_SUPPORT=false in the setup.py file works for my purpose.

stale

Most helpful comment

Hi @nicolebd,

You need to install libpng16-dev. Last merges into master require these new dependencies

sudo apt-get install libpng16-dev libtiff5-dev libjpeg-dev

All 8 comments

Hi @nicolebd,

You need to install libpng16-dev. Last merges into master require these new dependencies

sudo apt-get install libpng16-dev libtiff5-dev libjpeg-dev

@nsubiron I tried to install libpng16-dev, it depends on libpng16-devtools - this lib conflicts with many other libs in my system, including ros. In ros I use libpng12. Is that possible to change version in carla to 12? How difficult it will be for me?

Hi @Unlingius, yes, it's a known issue, unfortunately our image library (Boost.GIL) does not support libpng12. You can apply the changes in #924 for now and save the images in TIFF.

Thank you so mush! It works fine!

@nsubiron i try to compile newest release 0.9.2 and this instruction doesn't work now. Compilation crashes with that error:
/usr/include/pngconf.h:383:12: error: unknown type name '__pngconf'
__pngconf.h__ in libpng already includes setjmp.h;
^
/usr/include/pngconf.h:383:21: error: cannot use dot operator on a type
__pngconf.h__ in libpng already includes setjmp.h;
^
/usr/include/pngconf.h:384:12: error: unknown type name '__dont__'
__dont__ include it again.;
^
/usr/include/pngconf.h:384:28: error: expected ';' after top level declarator
__dont__ include it again.;

How can i fix it?

fixed. see extra_compile_args += ['-DLIBCARLA_IMAGE_WITH_PNG_SUPPORT=true'] in PythonAPI/setup.py

Thanks, Unlingius. Changing 'true' to 'false' makes it work!

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

Was this page helpful?
0 / 5 - 0 ratings