compiler errors - Compiling static 32-bit Qt on 64 bit machine -


i have 64 bit ubuntu machine. , have managed configure , compile qt5 static libraries using following configure options

-static -release -prefix /opt/qt-5.8.1 -confirm-license -nomake examples -nomake tests -opensource -qt-xcb -no-sql-psql -skip qt3d -fontconfig 

now, want create 32-bit static qt build. so, added additional -xplatform linux-g++-32 option while configuring.

but, following 2 (unrelated?) errors

error: feature 'fontconfig' enabled, pre-condition '!config.win32 && !config.darwin && features.system-freetype && libs.fontconfig' failed.

error: opengl functionality tests failed! might need modify include , library search paths editing qmake_incdir_opengl[_es2], qmake_libdir_opengl[_es2] , qmake_libs_opengl[_es2] in mkspec platform.

i think missing small here - missing 32-bit development libraries. don't know should installing on 64-bit machine enable 32-bit cross-compilation.

if there quick , easy fix above errors, please let me know.

thanks abhinav.

ok, let me answer own question. or @ least share worked me finally.

background

having built qt-5 on ubuntu 16.04 64-bit machine using above options , thereafter creating 64-bit statically linked executable project, looking same in 32 bits.

problem

could not close on correct set of configuration options , build environment setup 32-bits

solution

  1. sudo apt-get install libfreetype6:i386
  2. sudo apt-get install libfreetype6-dev:i386

then change following options when calling ./configure qt.

-prefix (path-to-qt32bit) -platform linux-g++-32 -i/usr/include/freetype2 -l/usr/lib/i386-linux-gnu

call make , make install. now, have 32-bit build of qt (on 64-bit machine)

gotcha

despite doing above, generated 32-bit executable of project wouldn't run on 32-bit machine.

i thought problem qt build.

but turned out running executable on ubuntu-12.04 machine. , libfreetype shipped in 12.04 not have methods ft_property_set. hence, seeing run-time undefined symbol errors.

as result, though executable compiled, couldn't run. solution me install ubuntu 16.04 (32-bit). executable ran without hitch.


Comments

Popular posts from this blog

python - Selenium remoteWebDriver (& SauceLabs) Firefox moseMoveTo action exception -

html - How to custom Bootstrap grid height? -

transpose - Maple isnt executing function but prints function term -