[Qt-creator] Problem building qt based code from libdash

Konstantin Tokarev annulen at yandex.ru
Sun Sep 11 19:35:21 CEST 2016



11.09.2016, 17:03, "Kapil Gupta" <kpgupta98 at gmail.com>:
> Hi,
>
> I am trying to build the code provided in the libdash repository which is based on qt. Now I am having this error:
> ```
> [  6%] Building CXX object CMakeFiles/qtsampleplayer.dir/libdashframework/Buffer/AudioChunk.cpp.o
> 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-master/libdash/qtplayer/libdashframework/Buffer/AudioChunk.h:16,
>                  from /home/cortana/libdash-master/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. "\
>     ^
> 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
> 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 understand that it says to run the code with -fPIC tag on. But I dont know and cant find out how to do so.

This error may happen when you have code which includes Qt headers, but its target does not link to any Qt library.

>
> Kapil Gupta
> ,
>
> _______________________________________________
> Qt-creator mailing list
> Qt-creator at qt-project.org
> http://lists.qt-project.org/mailman/listinfo/qt-creator


-- 
Regards,
Konstantin



More information about the Qt-creator mailing list