kitao / pyxel

A retro game engine for Python
MIT License
14.64k stars 825 forks source link

Can't compile on Pocket CHIP #225

Closed anjiro closed 4 years ago

anjiro commented 4 years ago

Describe the bug I'm hoping to run Pyxel on the Pocket C.H.I.P., a defunct Debian-based Linux-based mini computer. However, I get compiler errors (see below). Maybe the version of GCC is too old (g++ (Debian 4.9.2-10+deb8u2) 4.9.2)?

Here are the errors:

chip@chip:~/pyxel/pyxel-master$ make -C pyxel/core clean all
make: Entering directory '/home/chip/pyxel/pyxel-master/pyxel/core'
rm -rf src/pyxelcore.o src/pyxelcore/constants.o src/pyxelcore/tilemap.o src/pyxelcore/audio.o src/pyxelcore/resource.o src/pyxelcore/gif_writer.o src/pyxelcore/window.o src/pyxelcore/image.o src/pyxelcore/system.o src/pyxelcore/music.o src/pyxelcore/channel.o src/pyxelcore/input.o src/pyxelcore/sound.o src/pyxelcore/recorder.o src/pyxelcore/graphics.o bin/linux/libpyxelcore.so
g++ -c src/pyxelcore.cc -o src/pyxelcore.o -Iinclude `sdl2-config --cflags` -std=gnu++14 -fPIC -O3
g++ -c src/pyxelcore/constants.cc -o src/pyxelcore/constants.o -Iinclude `sdl2-config --cflags` -std=gnu++14 -fPIC -O3
g++ -c src/pyxelcore/tilemap.cc -o src/pyxelcore/tilemap.o -Iinclude `sdl2-config --cflags` -std=gnu++14 -fPIC -O3
g++ -c src/pyxelcore/audio.cc -o src/pyxelcore/audio.o -Iinclude `sdl2-config --cflags` -std=gnu++14 -fPIC -O3
g++ -c src/pyxelcore/resource.cc -o src/pyxelcore/resource.o -Iinclude `sdl2-config --cflags` -std=gnu++14 -fPIC -O3
g++ -c src/pyxelcore/gif_writer.cc -o src/pyxelcore/gif_writer.o -Iinclude `sdl2-config --cflags` -std=gnu++14 -fPIC -O3
src/pyxelcore/gif_writer.cc: In constructor ‘pyxelcore::GifWriter::GifWriter(const string&, int32_t, int32_t, const PaletteColor&, int32_t)’:
src/pyxelcore/gif_writer.cc:65:8: error: use of deleted function ‘std::basic_ofstream<char>& std::basic_ofstream<char>::operator=(const std::basic_ofstream<char>&)’
   ofs_ = std::ofstream(filename);
        ^
In file included from include/pyxelcore/constants.h:14:0,
                 from include/pyxelcore/common.h:4,
                 from include/pyxelcore/gif_writer.h:4,
                 from src/pyxelcore/gif_writer.cc:1:
/usr/include/c++/4.9/fstream:602:11: note: ‘std::basic_ofstream<char>& std::basic_ofstream<char>::operator=(const std::basic_ofstream<char>&)’ is implicitly deleted because the default definition would be ill-formed:
     class basic_ofstream : public basic_ostream<_CharT,_Traits>
           ^
/usr/include/c++/4.9/fstream:602:11: error: use of deleted function ‘std::basic_ostream<char>& std::basic_ostream<char>::operator=(const std::basic_ostream<char>&)’
In file included from /usr/include/c++/4.9/istream:39:0,
                 from /usr/include/c++/4.9/fstream:38,
                 from include/pyxelcore/constants.h:14,
                 from include/pyxelcore/common.h:4,
                 from include/pyxelcore/gif_writer.h:4,
                 from src/pyxelcore/gif_writer.cc:1:
/usr/include/c++/4.9/ostream:58:11: note: ‘std::basic_ostream<char>& std::basic_ostream<char>::operator=(const std::basic_ostream<char>&)’ is implicitly deleted because the default definition would be ill-formed:
     class basic_ostream : virtual public basic_ios<_CharT, _Traits>
           ^
/usr/include/c++/4.9/ostream:58:11: error: use of deleted function ‘std::basic_ios<char>& std::basic_ios<char>::operator=(const std::basic_ios<char>&)’
In file included from /usr/include/c++/4.9/ios:44:0,
                 from /usr/include/c++/4.9/istream:38,
                 from /usr/include/c++/4.9/fstream:38,
                 from include/pyxelcore/constants.h:14,
                 from include/pyxelcore/common.h:4,
                 from include/pyxelcore/gif_writer.h:4,
                 from src/pyxelcore/gif_writer.cc:1:
/usr/include/c++/4.9/bits/basic_ios.h:66:11: note: ‘std::basic_ios<char>& std::basic_ios<char>::operator=(const std::basic_ios<char>&)’ is implicitly deleted because the default definition would be ill-formed:
     class basic_ios : public ios_base
           ^
In file included from /usr/include/c++/4.9/ios:42:0,
                 from /usr/include/c++/4.9/istream:38,
                 from /usr/include/c++/4.9/fstream:38,
                 from include/pyxelcore/constants.h:14,
                 from include/pyxelcore/common.h:4,
                 from include/pyxelcore/gif_writer.h:4,
                 from src/pyxelcore/gif_writer.cc:1:
/usr/include/c++/4.9/bits/ios_base.h:789:5: error: ‘std::ios_base& std::ios_base::operator=(const std::ios_base&)’ is private
     operator=(const ios_base&);
     ^
In file included from /usr/include/c++/4.9/ios:44:0,
                 from /usr/include/c++/4.9/istream:38,
                 from /usr/include/c++/4.9/fstream:38,
                 from include/pyxelcore/constants.h:14,
                 from include/pyxelcore/common.h:4,
                 from include/pyxelcore/gif_writer.h:4,
                 from src/pyxelcore/gif_writer.cc:1:
/usr/include/c++/4.9/bits/basic_ios.h:66:11: error: within this context
     class basic_ios : public ios_base
           ^
In file included from include/pyxelcore/constants.h:14:0,
                 from include/pyxelcore/common.h:4,
                 from include/pyxelcore/gif_writer.h:4,
                 from src/pyxelcore/gif_writer.cc:1:
/usr/include/c++/4.9/fstream:602:11: error: use of deleted function ‘std::basic_filebuf<char>& std::basic_filebuf<char>::operator=(const std::basic_filebuf<char>&)’
     class basic_ofstream : public basic_ostream<_CharT,_Traits>
           ^
/usr/include/c++/4.9/fstream:72:11: note: ‘std::basic_filebuf<char>& std::basic_filebuf<char>::operator=(const std::basic_filebuf<char>&)’ is implicitly deleted because the default definition would be ill-formed:
     class basic_filebuf : public basic_streambuf<_CharT, _Traits>
           ^
In file included from /usr/include/c++/4.9/ios:43:0,
                 from /usr/include/c++/4.9/istream:38,
                 from /usr/include/c++/4.9/fstream:38,
                 from include/pyxelcore/constants.h:14,
                 from include/pyxelcore/common.h:4,
                 from include/pyxelcore/gif_writer.h:4,
                 from src/pyxelcore/gif_writer.cc:1:
/usr/include/c++/4.9/streambuf:810:7: error: ‘std::basic_streambuf<_CharT, _Traits>& std::basic_streambuf<_CharT, _Traits>::operator=(const std::basic_streambuf<_CharT, _Traits>&) [with _CharT = char; _Traits = std::char_traits<char>]’ is private
       operator=(const basic_streambuf&) { return *this; };
       ^
In file included from include/pyxelcore/constants.h:14:0,
                 from include/pyxelcore/common.h:4,
                 from include/pyxelcore/gif_writer.h:4,
                 from src/pyxelcore/gif_writer.cc:1:
/usr/include/c++/4.9/fstream:72:11: error: within this context
     class basic_filebuf : public basic_streambuf<_CharT, _Traits>
           ^
Makefile:86: recipe for target 'src/pyxelcore/gif_writer.o' failed
make: *** [src/pyxelcore/gif_writer.o] Error 1
make: Leaving directory '/home/chip/pyxel/pyxel-master/pyxel/core'
kitao commented 4 years ago

I haven't tried compile on Pocket CHIP, but I think so. Please check the Makefile of the Pyxel core library. https://github.com/kitao/pyxel/blob/master/pyxel/core/Makefile