Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
kgupta15 opened this issue Sep 16, 2016 · 3 comments
Open

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

kgupta15 opened this issue Sep 16, 2016 · 3 comments

Comments

@kgupta15
Copy link

kgupta15 commented Sep 16, 2016

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.

@kgupta15 kgupta15 changed the title Error while building qtsampleplayer on Ubuntu 16.04 "-fPIC" error while building qtsampleplayer on Ubuntu 16.04 Sep 16, 2016
@ysaidcan
Copy link

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

@kgupta15
Copy link
Author

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
Copy link

xgw commented Jan 25, 2018

@daemonslayer it really helps me solving it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants