Thread: Help compiling Pygame for Python3
hi all. i'm trying compile pygame 1.9.1 python3 in system. however, run errors gcc.
gcc errors (from running `python setup.py`):
the setup file generated config.py:code:gcc -pthread -fno-strict-aliasing -dndebug -g -fwrapv -o2 -wall -wstrict-prototypes -fpic -d_reentrant -i/usr/x11r6/include -i/usr/include/sdl -i/usr/include/python2.6 -c src/_numericsurfarray.c -o build/temp.linux-i686-2.6/src/_numericsurfarray.o in file included src/_numericsurfarray.c:23: src/pygame.h:75:20: error: python.h: no such file or directory in file included src/_numericsurfarray.c:23: src/pygame.h:122: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘lenfunc’ src/pygame.h:123: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘ssizeargfunc’ src/pygame.h:124: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘ssizeobjargproc’ src/pygame.h:125: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘ssizessizeargfunc’ src/pygame.h:126: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘ssizessizeobjargproc’ src/pygame.h:127: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘readbufferproc’ src/pygame.h:128: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘writebufferproc’ src/pygame.h:129: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘segcountproc’ src/pygame.h:130: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘charbufferproc’ src/pygame.h:234: error: expected specifier-qualifier-list before ‘pyobject_head’ src/pygame.h:275: error: expected specifier-qualifier-list before ‘pyobject_head’ src/pygame.h:310: error: expected specifier-qualifier-list before ‘pyobject_head’ src/pygame.h:349: error: expected specifier-qualifier-list before ‘pyobject_head’ src/pygame.h:387: error: expected specifier-qualifier-list before ‘pyobject_head’ src/pygame.h:450: error: expected specifier-qualifier-list before ‘pyobject’ src/pygame.h:457: error: expected specifier-qualifier-list before ‘pyobject_head’ src/pygame.h:499: error: expected specifier-qualifier-list before ‘pyobject_head’ src/pygame.h:567: error: expected specifier-qualifier-list before ‘pyobject_head’ in file included src/_numericsurfarray.c:25: src/numeric_arrayobject.h:66: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token src/numeric_arrayobject.h:67: error: expected ‘)’ before ‘*’ token src/numeric_arrayobject.h:72: error: expected specifier-qualifier-list before ‘pyarray_getitemfunc’ src/numeric_arrayobject.h:92: error: expected specifier-qualifier-list before ‘pyobject_head’ src/numeric_arrayobject.h:114: error: expected specifier-qualifier-list before ‘py_intptr_t’ src/_numericsurfarray.c:28: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token src/_numericsurfarray.c:100: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token src/_numericsurfarray.c:140: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token src/_numericsurfarray.c:189: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token src/_numericsurfarray.c:290: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token src/_numericsurfarray.c:431: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token src/_numericsurfarray.c:536: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token src/_numericsurfarray.c:651: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token src/_numericsurfarray.c:835: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token src/_numericsurfarray.c:1058: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token src/_numericsurfarray.c:1121: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘surfarray_builtins’ src/_numericsurfarray.c: in function ‘init_numericsurfarray’: src/_numericsurfarray.c:1148: error: ‘pyobject’ undeclared (first use in function) src/_numericsurfarray.c:1148: error: (each undeclared identifier reported once src/_numericsurfarray.c:1148: error: each function appears in.) src/_numericsurfarray.c:1148: error: ‘_module’ undeclared (first use in function) src/_numericsurfarray.c:1148: warning: implicit declaration of function ‘pyimport_importmodule’ src/_numericsurfarray.c:1148: error: ‘_dict’ undeclared (first use in function) src/_numericsurfarray.c:1148: warning: implicit declaration of function ‘pymodule_getdict’ src/_numericsurfarray.c:1148: error: ‘_c_api’ undeclared (first use in function) src/_numericsurfarray.c:1148: warning: implicit declaration of function ‘pydict_getitemstring’ src/_numericsurfarray.c:1148: warning: implicit declaration of function ‘pycobject_check’ src/_numericsurfarray.c:1148: warning: implicit declaration of function ‘pycobject_asvoidptr’ src/_numericsurfarray.c:1148: warning: implicit declaration of function ‘py_decref’ src/_numericsurfarray.c:1149: warning: implicit declaration of function ‘pyerr_occurred’ src/_numericsurfarray.c:1156: error: ‘numpy’ undeclared (first use in function) src/_numericsurfarray.c:1156: error: ‘module_dict’ undeclared (first use in function) src/_numericsurfarray.c:1156: error: ‘c_api_object’ undeclared (first use in function) src/_numericsurfarray.c:1162: warning: implicit declaration of function ‘py_initmodule3’ src/_numericsurfarray.c:1162: error: ‘surfarray_builtins’ undeclared (first use in function) error: command 'gcc' failed exit status 1
can me make sense of this? also, able install python 3 if invoking `python` in command line , not `python3` (invoking `python3 setup.py` returns error due call raw_input(). i'm adamant in converting using 2to3 might break dependencies.)?code:#this setup file used setup.py script configure #python extensions. use "config.py" #build correct setup file based on system settings. #if not, format simple enough edit hand. first change #the needed commandline flags each dependency, comment out #any unavailable optional modules in first optional section. sdl = -i/usr/x11r6/include -i/usr/include/sdl -d_reentrant -l/usr/lib -lsdl font = -lsdl_ttf image = -lsdl_image mixer = -lsdl_mixer smpeg = -i/usr/include/smpeg -i/usr/include/sdl -d_reentrant -l/usr/lib -lsmpeg -l/usr/lib -lsdl png = -i/usr/include -l/usr/lib -lpng jpeg = -i/usr/include -l/usr/lib -ljpeg scrap = -l/usr/lib -lx11 portmidi = -lportmidi porttime = -lporttime #debug = -c-w -c-wall debug = #the following modules optional. want compile #everything can, can ignore ones don't have #dependencies for, comment them out #imageext src/imageext.c $(sdl) $(image) $(png) $(jpeg) $(debug) #font src/font.c $(sdl) $(font) $(debug) #mixer src/mixer.c $(sdl) $(mixer) $(debug) #mixer_music src/music.c $(sdl) $(mixer) $(debug) _numericsurfarray src/_numericsurfarray.c $(sdl) $(debug) #_numericsndarray src/_numericsndarray.c $(sdl) $(mixer) $(debug) movie src/movie.c $(sdl) $(smpeg) $(debug) scrap src/scrap.c $(sdl) $(scrap) $(debug) _camera src/_camera.c src/camera_v4l2.c src/camera_v4l.c $(sdl) $(debug) #pypm src/pypm.c $(sdl) $(portmidi) $(porttime) $(debug) gfx = src/sdl_gfx/sdl_gfxprimitives.c #gfx = src/sdl_gfx/sdl_gfxblitfunc.c src/sdl_gfx/sdl_gfxprimitives.c gfxdraw src/gfxdraw.c $(sdl) $(gfx) $(debug) #these modules required pygame run. require #sdl dependency. these should not altered base src/base.c $(sdl) $(debug) cdrom src/cdrom.c $(sdl) $(debug) color src/color.c $(sdl) $(debug) constants src/constants.c $(sdl) $(debug) display src/display.c $(sdl) $(debug) event src/event.c $(sdl) $(debug) fastevent src/fastevent.c src/fastevents.c $(sdl) $(debug) key src/key.c $(sdl) $(debug) mouse src/mouse.c $(sdl) $(debug) rect src/rect.c $(sdl) $(debug) rwobject src/rwobject.c $(sdl) $(debug) surface src/surface.c src/alphablit.c src/surface_fill.c $(sdl) $(debug) surflock src/surflock.c $(sdl) $(debug) time src/time.c $(sdl) $(debug) joystick src/joystick.c $(sdl) $(debug) draw src/draw.c $(sdl) $(debug) image src/image.c $(sdl) $(debug) overlay src/overlay.c $(sdl) $(debug) transform src/transform.c src/rotozoom.c src/scale2x.c src/scale_mmx.c $(sdl) $(debug) -d_no_mmx_for_x86_64 mask src/mask.c src/bitmask.c $(sdl) $(debug) bufferproxy src/bufferproxy.c $(sdl) $(debug) pixelarray src/pixelarray.c $(sdl) $(debug) _arraysurfarray src/_arraysurfarray.c $(sdl) $(debug)
*bump*
followed instructions @ http://ubuntuforums.org/showpost.php...68&postcount=2 install pygame in python 3 error described above persists.
Forum The Ubuntu Forum Community Ubuntu Specialised Support Development & Programming Programming Talk Help compiling Pygame for Python3
Ubuntu
Comments
Post a Comment