2015-10-13 39 views
2

我想在ubuntu上安裝pymedia以使用python 2.7運行腳本。於是,我就找到了依賴性並得到了他們的安裝:嘗試在Ubuntu下安裝pymedia時出現「error:command'C++'failed with exit status 1」

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錯誤。如果有人能指出這裏可能會出現什麼問題,這將會非常有幫助。

回答

2

解決:

OGG : not found 
VORBIS : not found 
FAAD : not found 
MP3LAME : not found 
VORBISENC : not found 
ALSA : not found 

下載:

  • downloads.xiph.org/releases/ogg/libogg-1.3.2.tar.gz
  • www.vorbis.com/ files/1.0.1/unix/libvorbis-1.0.1.tar.gz
  • downloads.sourceforge.net/faac/faad2-2.7.ta​​r.gz
  • sourceforge.net/projects/lame/files/lame/ 3.96。 ?1 /跛腳3.96.1.tar.gz /下載use_mirror = UFPR &下載=

,並在所有情況下編譯:

./configure 
make 
sudo make install 
相關問題