Обнаружено «ошибка: команда« c ++ »завершилась неудачно с состоянием выхода 1» при попытке установить pymedia в Ubuntu

Я пытаюсь установить pymedia в Ubuntu для запуска скриптов с использованием Python 2.7. Итак, я отследил зависимости и установил их:

sudo apt-get install python-dev libogg-dev libvorbis-dev liblame-dev libfaad2-dev libasound2-dev python-pygame libmp3lame-dev libevent-dev

Итак, когда я закончил установку вышеупомянутого, на следующем шаге, который должен был собрать pymedia, я получил следующее:

Using UNIX configuration...

OGG          : not found
VORBIS       : not found
FAAD         : not found
MP3LAME      : not found
VORBISENC    : not found
ALSA         : not found
Continue building pymedia ? [Y,n]:y
running build
running build_py
running build_ext
building 'pymedia.audio.sound' extension
x86_64-linux-gnu-gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -DBUILD_NUM=1866 -DPATH_DEV_DSP="/dev/dsp" -DPATH_DEV_MIXER="/dev/mixer" -D_FILE_OFFSET_BITS=64 -DACCEL_DETECT=1 -DHAVE_MMX=1 -DHAVE_LINUX_DVD_STRUCT=1 -DDVD_STRUCT_IN_LINUX_CDROM_H=1 -DHAVE_AV_CONFIG_H -DUDF_CACHE=1 -I/home/simran/Downloads/pymedia-1.3.7.3 -Isound/ -I/usr/include/python2.7 -c sound/sound.cpp -o build/temp.linux-x86_64-2.7/sound/sound.o
cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++ [enabled by default]
<command-line>:0:14: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
sound/audio_unix.h:54:18: note: in expansion of macro ‘PATH_DEV_DSP’
static char *dsp=PATH_DEV_DSP;
              ^
<command-line>:0:16: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
sound/audio_unix.h:55:15: note: in expansion of macro ‘PATH_DEV_MIXER’
char *mixer = PATH_DEV_MIXER;
           ^
In file included from sound/sound.cpp:33:0:
sound/audio_unix.h: In member function ‘bool Mixer::SetControlValue(int, int, int, int, int)’:
sound/audio_unix.h:838:7: warning: suggest explicit braces to avoid ambiguous ‘else’ [-Wparentheses]
 if( iControl )
   ^
sound/sound.cpp: At global scope:
sound/sound.cpp:791:1: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
 };
 ^
sound/sound.cpp:791:1: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
sound/sound.cpp:791:1: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
sound/sound.cpp:791:1: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
sound/sound.cpp:791:1: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
sound/sound.cpp:791:1: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
sound/sound.cpp:791:1: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
sound/sound.cpp:791:1: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
sound/sound.cpp:791:1: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
sound/sound.cpp:791:1: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
sound/sound.cpp:798:1: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
};
^
sound/sound.cpp:798:1: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
sound/sound.cpp: In function ‘void initsound()’:
sound/sound.cpp:1451:66: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
g_cErr = PyErr_NewException(MODULE_NAME".SoundError", NULL, NULL);
                                                              ^
x86_64-linux-gnu-gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -DBUILD_NUM=1866 -DPATH_DEV_DSP="/dev/dsp" -DPATH_DEV_MIXER="/dev/mixer" -D_FILE_OFFSET_BITS=64 -DACCEL_DETECT=1 -DHAVE_MMX=1 -DHAVE_LINUX_DVD_STRUCT=1 -DDVD_STRUCT_IN_LINUX_CDROM_H=1 -DHAVE_AV_CONFIG_H -DUDF_CACHE=1 -I/home/simran/Downloads/pymedia-1.3.7.3 -Isound/ -I/usr/include/python2.7 -c sound/resample.c -o build/temp.linux-x86_64-2.7/sound/resample.o
sound/resample.c: In function ‘fractional_resample’:
sound/resample.c:48:24: warning: variable ‘incr’ set but not used [-Wunused-but-set-variable]
 unsigned int frac, incr;
                    ^
x86_64-linux-gnu-gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -DBUILD_NUM=1866 -DPATH_DEV_DSP="/dev/dsp" -DPATH_DEV_MIXER="/dev/mixer" -D_FILE_OFFSET_BITS=64 -DACCEL_DETECT=1 -DHAVE_MMX=1 -DHAVE_LINUX_DVD_STRUCT=1 -DDVD_STRUCT_IN_LINUX_CDROM_H=1 -DHAVE_AV_CONFIG_H -DUDF_CACHE=1 -I/home/simran/Downloads/pymedia-1.3.7.3 -Isound/ -I/usr/include/python2.7 -c sound/fft.cpp -o build/temp.linux-x86_64-2.7/sound/fft.o
cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++ [enabled by default]
c++ -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions -Wl,-z,relro -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -D_FORTIFY_SOURCE=2 -g -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security build/temp.linux-x86_64-2.7/sound/sound.o build/temp.linux-x86_64-2.7/sound/resample.o build/temp.linux-x86_64-2.7/sound/fft.o -o build/lib.linux-x86_64-2.7/pymedia/audio/sound.so
/usr/bin/ld: build/temp.linux-x86_64-2.7/sound/sound.o: relocation R_X86_64_32 against `_Py_NoneStruct' can not be used when making a shared object; recompile with -fPIC
build/temp.linux-x86_64-2.7/sound/sound.o: error adding symbols: Bad value
collect2: error: ld returned 1 exit status
error: command 'c++' failed with exit status 1

Как видно из распечаток, пакеты (несмотря на правильную установку) упоминаются как «не найдены». И нижняя строка ошибки выглядит как ошибка GCC для меня. Было бы очень полезно, если бы кто-то мог указать, что здесь может пойти не так.

1
задан 14 October 2015 в 14:59

1 ответ

Многие, у многих людей есть эта проблема - это происходит, скорее всего, из-за испорченного сценария.

, По-видимому, разделенные библиотеки 64 битов должны быть собраны с -fPIC, флаг и sound.cpp не в этом случае.

В setup.py есть функция, вызванная disable_fPIC() - Вы можете отключить функцию, просто заменив весь кодекс, который принадлежит ей с заявлением pass. Так:

def disable_fPIC():
  pass
0
ответ дан 15 October 2015 в 00:59

Другие вопросы по тегам:

Похожие вопросы: