<div dir="ltr"><div><div><div>Hi Tomaz,<br></div>The CXX_COMPILER_FLAGS part of cmakeLists.txt looks like:<br><br>********-----------------********<br><br>include(CheckCXXCompilerFlag)<br>CHECK_CXX_COMPILER_FLAG("-std=c++11" COMPILER_SUPPORTS_CXX11)<br>
CHECK_CXX_COMPILER_FLAG("-std=c++0x" COMPILER_SUPPORTS_CXX0X)<br>if(COMPILER_SUPPORTS_CXX11)<br>    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")<br>elseif(COMPILER_SUPPORTS_CXX0X)<br>    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x")<br>
else()<br>        message(STATUS "The compiler ${CMAKE_CXX_COMPILER} has no C++11 support. Please use a different C++ compiler.")<br>endif()<br><br>*************---------------------************<br><br></div> How should I add fPIC to this. <br>
</div><br><br> </div><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Jul 10, 2014 at 8:51 PM, Tomaz Canabrava <span dir="ltr"><<a href="mailto:tcanabrava@kde.org" target="_blank">tcanabrava@kde.org</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="">On Thu, Jul 10, 2014 at 12:17 PM, Devanshu Jain<br>
<<a href="mailto:devanshu.jain919@gmail.com">devanshu.jain919@gmail.com</a>> wrote:<br>
> I already tried that but I think cmake does not realise -fPIC/fPIE as a<br>
> valid option. So it considers that a file exists with the same name and<br>
> shows me the following error:<br>
> CMake Error: The source directory<br>
> "/home/devanshu/Documents/PMC/plasma-mediacenter/build/-fPIC" does not<br>
> exist.<br>
<br>
</div>What? no no no,<br>
You must add -fPIC as the CXX_COMPILER_FLAGS, how's your CMakeLists.txt?<br>
It seems that you are adding -fPIC at the wrong location.<br>
<div class="HOEnZb"><div class="h5"><br>
><br>
> On Thu, Jul 10, 2014 at 8:41 PM, Tomaz Canabrava <<a href="mailto:tcanabrava@kde.org">tcanabrava@kde.org</a>> wrote:<br>
>><br>
>> Devanshu,<br>
>><br>
>> I know it's frustrating to begin in a very complex and huge software<br>
>> as KDE and Plasma, belive me - this happened to me 6 years ago.<br>
>> It's very important to try to understand the errors that you have<br>
>> before asking for help, really. Holding hands is cool but not the most<br>
>> efficient way to learn.<br>
>><br>
>> for instance, in the second one<br>
>><br>
>>  /usr/include/qt5/QtCore/<br>
>> qglobal.h:1008:4: error: #error "You must build your code with<br>
>> position independent code if Qt was built with -reduce-relocations. "<br>
>> "Compile your code with -fPIC or -fPIE."<br>
>>  #  error "You must build your code with position independent code if<br>
>> Qt was built with -reduce-relocations. "\<br>
>><br>
>> This means that your Qt was build with -reduce-relocations and you<br>
>> must compile your code with -fPIC , as the error says.<br>
>> so, go to your CMake and add -fPIC to the CXX_COMPILER_FLAGS , and try<br>
>> again. :)<br>
>><br>
>> Tomaz<br>
>> _______________________________________________<br>
>> Plasma-devel mailing list<br>
>> <a href="mailto:Plasma-devel@kde.org">Plasma-devel@kde.org</a><br>
>> <a href="https://mail.kde.org/mailman/listinfo/plasma-devel" target="_blank">https://mail.kde.org/mailman/listinfo/plasma-devel</a><br>
><br>
><br>
><br>
> _______________________________________________<br>
> Plasma-devel mailing list<br>
> <a href="mailto:Plasma-devel@kde.org">Plasma-devel@kde.org</a><br>
> <a href="https://mail.kde.org/mailman/listinfo/plasma-devel" target="_blank">https://mail.kde.org/mailman/listinfo/plasma-devel</a><br>
><br>
_______________________________________________<br>
Plasma-devel mailing list<br>
<a href="mailto:Plasma-devel@kde.org">Plasma-devel@kde.org</a><br>
<a href="https://mail.kde.org/mailman/listinfo/plasma-devel" target="_blank">https://mail.kde.org/mailman/listinfo/plasma-devel</a><br>
</div></div></blockquote></div><br></div>