728x90

i686(64bit)에서 

/usr/include/features.h:324:26: fatal error: bits/predefs.h: No such file or directory 

와 같은 오류가 발생할 때


solution:

apt-get install gcc-multilib



728x90
728x90

1. Qt install

 

Qt 4.7.4 download

ftp://ftp.trolltech.com/qt/source/qt-everywhere-opensource-src-4.7.4.tar.gz

 

$ tar zxvf qt-everywhere-opensource-src-4.7.4.tar.gz

$ cd qt-everywhere-opensource-src-4.7.4

$ mkdir ./mkspecs/qws/linux-target-g++

$ cd ./mkspecs/qws/linux- target-g++

$ cp ../linux-arm-g++/qplatformdefs.h ./

$ vi qmake.conf

# qmake configuration for building with arm- target-g++

#

 

include(../../common/g++.conf)

include(../../common/linux.conf)

include(../../common/qws.conf)

 

# modifications to g++.conf

#Toolchain

 

#Compiler Flags to take advantage of the ARM architecture

QMAKE_CFLAGS_RELEASE =   -O3 -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp

QMAKE_CXXFLAGS_RELEASE = -O3 -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp

 

QMAKE_CC = arm-none-linux-gnueabi-gcc

QMAKE_CXX = arm-none-linux-gnueabi-g++

QMAKE_LINK = arm-none-linux-gnueabi-g++

QMAKE_LINK_SHLIB = arm-none-linux-gnueabi-g++

 

# modifications to linux.conf

QMAKE_AR = arm-none-linux-gnueabi-ar cqs

QMAKE_OBJCOPY = arm-none-linux-gnueabi-objcopy

QMAKE_STRIP = arm-none-linux-gnueabi-strip

 

load(qt_config)

 

$ cd ../../.. (source directory)

$ ./configure -prefix <qt-install-dir> -embedded arm -platform qws/linux-x86-g++ -xplatform qws/linux-mdas-g++ -depths 16,24,32 -no-mmx -no-3dnow -no-sse -no-sse2 -no-glib -no-cups -no-largefile -no-accessibility -no-openssl -no-gtkstyle -qt-mouse-pc -qt-mouse-linuxtp -qt-mouse-linuxinput -plugin-mouse-linuxtp -plugin-mouse-pc -fast -little-endian

 

$ make

$ make install


## qmake.conf에서 cross compiler지정해주는 부분과 configure option 주는 부분이 중요.



오류 처리

error1:

libQtCore.so: undefined reference to `QInotifyFileSystemWatcherEngine::create()'

 

resolution:

edit ./src/corelib/io/io.pri

find linux-*:

append your cross-toolchain's prefix after it

 

ex> my toolchains's prefix is arm-none-linux-gnueabi-XXX

 

- 77         linux-*|:!symbian {

 

+ 77         linux-*| arm-none-linux-gnueabi-*:!symbian {

 78             SOURCES += \

 79                     io/qfilesystemwatcher_inotify.cpp \

 80                     io/qfilesystemwatcher_dnotify.cpp

 81

 82             HEADERS += \

 83                     io/qfilesystemwatcher_inotify_p.h \

 84                     io/qfilesystemwatcher_dnotify_p.h

 85         }

 86

 87         freebsd-*|macx-*|darwin-*|openbsd-*:{

 88             SOURCES += io/qfilesystemwatcher_kqueue.cpp

 89             HEADERS += io/qfilesystemwatcher_kqueue_p.h

 90         }

 

 

error2:

libQtCore.so: undefined reference to `clock_gettime'

 

resolution:

append "-lrt" parameters after the "./configure" so that the compiler can find the define in librt.


 

2. Compile

 

Qt를 설치할 때 -prefix <qt-install-dir> 옵션을 주었기 때문에 관련 tool들이 <qt-install-dir>에 있다.

 

cd path/to/myApplication (sources .pro 파일이 있다.)

 

$ <qt-install-dir>/bin/qmake –project

$ <qt-install-dir>/bin/qmake

$ make

 

정상적으로 생성되었는지 확인(결과 파일이 test1이라 할 때)

$ file test1

test1: ELF 32-bit LSB executable, ARM, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.16, not stripped

 


 

3. Execute

 

* lib 등록

LD_LIBRARY_PATH 가 맞지 않으면 다음과 같은 오류가 발생한다.

ERROR: Inconsistency detected by ld.so: dl-deps.c: 622: _dl_map_object_deps: Assertion `nlist > 1' failed!

 

<qt-install-dir>/lib 안에 있는 library를 모두 target board에 복사한다. 이 때 fonts도 함께 복사한다

복사한 library target board에서 /mnt/mmc/lib에 존재한다고 가정함.

 

target$ export QTDIR=/mnt/mmc

target$ export LD_LIBRARY_PATH=$QTDIR/lib:$LD_LIBRARY_PATH

 

 

 

* fonts 등록

fonts가 등록되지 않으면 다음과 같은 오류가 발생한다.

QFontDatabase: Cannot find font directory /opt/Qtarm/lib/fonts - is Qt installed correctly?

 

target$ mkdir <qt-install-dir>

target$ mkdir <qt-install-dir>/lib

target$ ln -s /mnt/mmc/lib/fonts  <qt-install-dir>/lib/fonts

 

 

 

* 파일 실행

$ ./test1 -qws

 

728x90
728x90

ERROR:

Can't locate Term/ReadKey.pm in @INC (@INC contains: /etc/perl /usr/local/lib/perl/5.14.2 /usr/local/share/perl/5.14.2 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.14 /usr/share/perl/5.14 /usr/local/lib/site_perl .) at config.pl line 13.
BEGIN failed--compilation aborted at config.pl line 13.

 

Solution:

$ perl -MCPAN -eshell

 

계속 yes하고 진행

 

Then at the cpan> prompt:

cpan> install Term::ReadKey

 

정리:

1. perl -MCPAN -eshell 이후 yes하면서 진행

2. install Term::ReadKey 이후 yes하면서 진행

설치가 끝나면 exit로 빠져나오기.

 

 

 

728x90
728x90

Error : (target: Desktop) When executing build step 'qmake'

 

원인 : qmake할 경로를 찾지 못함.

path에 한글이나 공백 또는 다른 프로젝트를 가져왔을 때 주로 발생함.

 

해결 : 프로젝트 세팅에서 경로를 다시 설정(없는 경로면 붉은 색으로 표시되고 있음)

 

 

 

728x90

+ Recent posts