[OpenWalnut-Dev] Release Branch and Qt5

Christof Pieloth pieloth at labp.htwk-leipzig.de
Thu Oct 23 14:38:38 CEST 2014


Hello again,

like I mentioned before, there is still an error during compilation:
#error "You must build your code with position independent code if Qt 
was built with -reduce-relocations. " "Compile your code with -fPIC or 
-fPIE."

I tried to re-compile Qt5, but I could not disable the 
"reduce-relocations" option. Furthermore I tried the version from the Qt 
Online Installer without success. The problem is known and is mentioned on:
http://qt-project.org/doc/qt-5/cmake-manual.html#using-qt-5-with-cmake-older-than-2-8-9

Based on this, I extended the legacy support by addind definitions and 
flags:

# Support for CMake older than 2.8.9
# 
http://qt-project.org/doc/qt-5/cmake-manual.html#using-qt-5-with-cmake-older-than-2-8-9
INCLUDE_DIRECTORIES( SYSTEM ${Qt5Widgets_INCLUDE_DIRS} )
INCLUDE_DIRECTORIES( SYSTEM ${Qt5OpenGL_INCLUDE_DIRS} )
INCLUDE_DIRECTORIES( SYSTEM ${Qt5WebKitWidgets_INCLUDE_DIRS} )

# Collect and set definitions
SET( _QT5_DEFINITIONS "" )
LIST( APPEND _QT5_DEFINITIONS ${Qt5Widgets_DEFINITIONS} )
LIST( APPEND _QT5_DEFINITIONS ${Qt5OpenGL_DEFINITIONS} )
LIST( APPEND _QT5_DEFINITIONS ${Qt5WebKitWidgets_DEFINITIONS} )
LIST( REMOVE_DUPLICATES _QT5_DEFINITIONS )
ADD_DEFINITIONS( ${_QT5_DEFINITIONS} )

# Collection and set compiler flags
SET( _QT5_EXECUTABLE_COMPILE_FLAGS "" )
LIST( APPEND _QT5_EXECUTABLE_COMPILE_FLAGS 
${Qt5Widgets_EXECUTABLE_COMPILE_FLAGS} )
LIST( APPEND _QT5_EXECUTABLE_COMPILE_FLAGS 
${Qt5OpenGL_EXECUTABLE_COMPILE_FLAGS} )
LIST( APPEND _QT5_EXECUTABLE_COMPILE_FLAGS 
${Qt5WebKitWidgets_EXECUTABLE_COMPILE_FLAGS} )
LIST( REMOVE_DUPLICATES _QT5_EXECUTABLE_COMPILE_FLAGS )
SET( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${_QT5_EXECUTABLE_COMPILE_FLAGS}")

Even Ubuntu 14.04 uses CMake 2.8.12, but Qt5 from repository seems to work.

Cheerio,
Christof

Am 23.10.2014 um 12:04 schrieb Sebastian Eichelbaum:
> You are right. I have added the include_directory directives to the CMakeLists.
>
> According to http://qt-project.org/doc/qt-5/cmake-manual.html "The minimum version required to use Qt5 is CMake 2.8.3, but 2.8.11 is recommended.". So, it works with your version but you  might experience problems.
>
> And sorry for insulting your stable, experienced Ubuntu version ;-).
>
> Cheers,
> Sebastian
>

-- 
Christof Pieloth, M.Sc.
Wissenschaftlicher Mitarbeiter

HTWK Leipzig, University of Applied Sciences
Laboratory for Biosignal Processing (LaBP)
Eilenburger Str. 13
04317 Leipzig

tel:  +49 (0) 341 3076 3133
fax:  +49 (0) 341 3076 853133
email: pieloth 'at' labp.htwk-leipzig.de
web: www.labp.htwk-leipzig.de



More information about the OpenWalnut-Dev mailing list