bitmovin / libdash

MPEG-DASH Access Library - Official ISO/IEC MPEG-DASH Reference Implementation
https://bitmovin.com/
589 stars 169 forks source link

"-fPIC" error while building qtsampleplayer on Ubuntu 16.04 #10

Open kgupta15 opened 8 years ago

kgupta15 commented 8 years ago

I have this error while building qtsampleplayer:

In file included from /usr/include/x86_64-linux-gnu/qt5/QtCore/qnamespace.h:37:0,
                 from /usr/include/x86_64-linux-gnu/qt5/QtCore/qobjectdefs.h:41,
                 from /usr/include/x86_64-linux-gnu/qt5/QtCore/qobject.h:40,
                 from /usr/include/x86_64-linux-gnu/qt5/QtMultimedia/qaudioformat.h:38,
                 from /home/cortana/libdash/libdash/qtplayer/libdashframework/Buffer/AudioChunk.h:16,
                 from /home/cortana/libdash/libdash/qtplayer/libdashframework/Buffer/AudioChunk.cpp:12:
/usr/include/x86_64-linux-gnu/qt5/QtCore/qglobal.h:1067:4: error: #error "You must build your code with position independent code if Qt was built with -reduce-relocations. " "Compile your code with -fPIC (-fPIE is not enough)."
 #  error "You must build your code with position independent code if Qt was built with -reduce-relocations. "\
    ^
[ 57%] Building CXX object CMakeFiles/qtsampleplayer.dir/libdashframework/Buffer/MediaObjectBuffer.cpp.o
[ 60%] Building CXX object CMakeFiles/qtsampleplayer.dir/libdashframework/Input/DASHReceiver.cpp.o
[ 63%] Building CXX object CMakeFiles/qtsampleplayer.dir/libdashframework/Input/MediaObject.cpp.o
CMakeFiles/qtsampleplayer.dir/build.make:389: recipe for target 'CMakeFiles/qtsampleplayer.dir/libdashframework/Buffer/AudioChunk.cpp.o' failed
make[2]: *** [CMakeFiles/qtsampleplayer.dir/libdashframework/Buffer/AudioChunk.cpp.o] Error 1
make[2]: *** Waiting for unfinished jobs....
CMakeFiles/Makefile2:63: recipe for target 'CMakeFiles/qtsampleplayer.dir/all' failed
make[1]: *** [CMakeFiles/qtsampleplayer.dir/all] Error 2
Makefile:75: recipe for target 'all' failed
make: *** [all] Error 2

I have used this command for cmake : ./cmake-2.8.11.2-Linux-i386/bin/cmake -DCMAKE_CXX_FLAGS="-fPIC" .. and also had edited the CMakeLists.txt of qtsampleplayer directory to add the -fPIC flag. The errors thrown by the code of libdash were removed by doing this but the qt is still throwing them. I have followed the instructions on README for installation of qt libraries.

ysaidcan commented 7 years ago

Did you solve this problem? I faced the same problem.

kgupta15 commented 7 years ago

I wasnt really able to solve it. What I did was: Instead of running the command ./cmake-2.8.11.2-Linux-i386/bin/cmake, I ran cmake .. again and then make -j4. That worked fine for me and I was able to install qtsampleplayer.

xgw commented 6 years ago

@daemonslayer it really helps me solving it