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