Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. QT5 Compilation - qglobal.h
Forum Updated to NodeBB v4.3 + New Features

QT5 Compilation - qglobal.h

Scheduled Pinned Locked Moved General and Desktop
3 Posts 3 Posters 3.0k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • N Offline
    N Offline
    nvharisha
    wrote on last edited by
    #1

    Hi,

    I tried to compile a qt 5.0 application. I found that it requires either -fPIC or -fPIE required to be passed even if I am building simple GUI application (Which is not a library). I checked sample test applications and they are passing -fPIE.
    In Qt 4.8, this was not mandatory.
    I would like to know why this has been added?
    Also if i want to know if I compile without passing fPIC or fPIE?

    Thanks

    Hari

    1 Reply Last reply
    0
    • C Offline
      C Offline
      ChrisW67
      wrote on last edited by
      #2

      Platform? Source of Qt libraries? Build system? Compiler I assume is GCC.

      Assuming the mention of qglobal.h is because the "error message":http://qt.gitorious.org/qt/qtbase/blobs/stable/src/corelib/global/qglobal.h#line975 you received is:

      bq. You must build your code with position independent code if Qt was built with -reduce-relocations. Compile your code with -fPIC or -fPIE.

      "The commit":http://qt.gitorious.org/qt/qtbase/commit/482d96a0c5d523ace63f56bda6851926b4469dd0/diffs installed this message but also ensures the qmake uses -fPIE for applications.

      I think the error message explains what you could do if you really need to avoid this: build Qt without the -reduce-relocations configure option.

      1 Reply Last reply
      0
      • R Offline
        R Offline
        rrr2
        wrote on last edited by
        #3

        I have the same problem and am getting the same error message. I compiled on Linux. My compilation steps are shown below. And you can see that
        -reduce-relocation is not enabled. Using the example problems that install with Qt and Creator-2.8 and cmake-2.8.11. I get the error message " You must build your code with position independent code if Qt was built with -reduce-relocations". Is there a step in the build process that may be missing?

        git clone git://gitorious.org/qt/qt5.git qt5
        cd qt5
        perl init-repository --no-webkit
        ./configure -prefix /opt/local/Qt-5.1.1 -developer-build -opensource -nomake examples -nomake tests -no-gtkstyle
        make
        make install

        1 Reply Last reply
        0

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved