python-mtp icon indicating copy to clipboard operation
python-mtp copied to clipboard

Build fails

Open zgoda opened this issue 9 years ago • 2 comments

Python 2.7.10, Cython 0.23.4, Ubuntu 14.04

$ python setup.py build
running build
running build_ext
cythoning mtp.pyx to mtp.c

Error compiling Cython file:
------------------------------------------------------------
...
        LIBMTP_FILETYPE_UNKNOWN = 44
    cdef struct LIBMTP_filesampledata_struct:
        uint32_t width
        uint32_t height
        uint32_t duration
        LIBMTP_filetype_t filetype
 ^
------------------------------------------------------------

libmtp.pxd:493:2: 'LIBMTP_filetype_t' is not a type identifier

Error compiling Cython file:
------------------------------------------------------------
...
        uint16_t bitratetype
        uint16_t rating
        uint32_t usecount
        uint64_t filesize
        time_t modificationdate
        LIBMTP_filetype_t filetype
 ^
------------------------------------------------------------

libmtp.pxd:805:2: 'LIBMTP_filetype_t' is not a type identifier

Error compiling Cython file:
------------------------------------------------------------
...
        uint16_t bitratetype
        uint16_t rating
        uint32_t usecount
        uint64_t filesize
        time_t modificationdate
        LIBMTP_filetype_t filetype
 ^
------------------------------------------------------------

libmtp.pxd:829:2: 'LIBMTP_filetype_t' is not a type identifier

Error compiling Cython file:
------------------------------------------------------------
...
        uint32_t parent_id
        uint32_t storage_id
        char * filename
        uint64_t filesize
        time_t modificationdate
        LIBMTP_filetype_t filetype
 ^
------------------------------------------------------------

libmtp.pxd:1118:2: 'LIBMTP_filetype_t' is not a type identifier

Error compiling Cython file:
------------------------------------------------------------
...
        uint32_t parent_id
        uint32_t storage_id
        char * filename
        uint64_t filesize
        time_t modificationdate
        LIBMTP_filetype_t filetype
 ^
------------------------------------------------------------

libmtp.pxd:1127:2: 'LIBMTP_filetype_t' is not a type identifier

Error compiling Cython file:
------------------------------------------------------------
...
            raise Exception('Not connected')
        r = LIBMTP_Get_File_To_File(self.device, object_id, target, NULL, NULL)
        if r != 0:
            raise Exception('LIBMTP_Get_File_To_File error={}'.format(r))

    cdef LIBMTP_filetype_t find_filetype(self, name):
     ^
------------------------------------------------------------

mtp.pyx:402:6: 'LIBMTP_filetype_t' is not a type identifier
building 'mtp' extension
gcc -pthread -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/usr/include -I/opt/python-2.7.10/include/python2.7 -c mtp.c -o build/temp.linux-x86_64-2.7/mtp.o -Wno-cast-qual -Wno-unused-but-set-variable
mtp.c:1:2: error: #error Do not use this file, it is the result of a failed Cython compilation.
 #error Do not use this file, it is the result of a failed Cython compilation.
  ^
error: command 'gcc' failed with exit status 1

zgoda avatar Dec 09 '15 13:12 zgoda

I can reproduce this with libmtp 1.1.14, gcc 7.3.0 and python 3.6.4.

Holzhaus avatar Feb 10 '18 13:02 Holzhaus

me too

antoniomolram avatar Jul 05 '23 09:07 antoniomolram