Tox (특히 toxcore)를 컴파일하려고합니다. 내가 컴파일 할 때, 나는 다음과 같은 오류가 발생 : 오류 메시지에 따라링크 오류 : "재배치 R_X86_64_32 ... 공유 객체를 만들 때 사용할 수 없으며 -fPIC를 사용하여 다시 컴파일하십시오"
>make
make all-recursive
make[1]: Entering directory '/root/Tox/toxcore'
Making all in build
make[2]: Entering directory '/root/Tox/toxcore/build'
CCLD libtoxav.la
/usr/bin/ld: /usr/local/lib/libvpx.a(vpx_codec.c.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
/usr/local/lib/libvpx.a: error adding symbols: Bad value
collect2: error: ld returned 1 exit status
Makefile:1385: recipe for target 'libtoxav.la' failed
make[2]: *** [libtoxav.la] Error 1
make[2]: Leaving directory '/root/Tox/toxcore/build'
Makefile:506: recipe for target 'all-recursive' failed
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory '/root/Tox/toxcore'
Makefile:410: recipe for target 'all' failed
make: *** [all] Error 2
을, 나는 configure
(./configure --enable-shared
)에 인수를 추가하여, (export CXXFLAGS="$CXXFLAGS -fPIC"
)를 C++ 플래그를 내보내 fPIC
를 사용하려고하고로했다 Makefile
(CC = gcc
에서 CC = gcc -fPIC
으로 변경)을 편집했지만 이러한 시도는 효과가 없으며 여전히 동일한 오류가 발생합니다. 무엇이 잘못 될 수 있습니까?
sudo apt-get install pkg-config
sudo apt-get install build-essential
sudo apt-get install libtool
sudo apt-get install autotools-dev
sudo apt-get install automake
sudo apt-get install checkinstall
sudo apt-get install check
sudo apt-get install git
sudo apt-get install yasm
cd ~
mkdir Tox
cd Tox
git clone https://github.com/jedisct1/libsodium.git
cd libsodium
git checkout tags/1.0.3
./autogen.sh
./configure && make check
sudo checkinstall --install --pkgname libsodium --pkgversion 1.0.0 --nodoc
sudo ldconfig
cd ..
git clone https://chromium.googlesource.com/webm/libvpx
cd libvpx
git checkout tags/v1.3.0
./configure
make
make install
cd ..
git clone https://github.com/irungentoo/toxcore.git
cd toxcore
autoreconf -i
./configure
make
sudo make install
cd ..
구성을 변경 한 후 이전 빌드를 지우셨습니까? 로그를 검사하여 컴파일 플래그에'-fPIC'을 실제로 추가했는지 확인할 수 있습니다. – Mine
@Mine 의견을 보내 주셔서 감사합니다. 예, 몇 가지 정리를 시도했습니다. 'config.log'에서 실제로 사용하고 있음을 나타내는'-fPIC '에 대한 참조를 봅니다 (예 :'gcc PIC 플래그 -fPIC -DPIC 작동 여부','결과 : 예'등). – d3pd