Project Home
Project Home
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
Forum Topic - Building examples: (5 Items)
   
Building examples  
Is it possible to build qt examples (user program) on nto6.5?  There is nothing in the 'readme' describing the required 
 build environment or caveats.

I was trying to build  'qt4/examples/declarative/toys/clocks' for example.

I have tried the instructions on self-hosted but to no avail.  The mentioned file 'build-hook' does not seem to be in 
the archive.

---------------------------------------------------------------------------------
Build targets for qmake
-----------------------

If your application is built with qmake, you can create QNX variants of the
application as follows (once the host and target packages are installed).

In the top-level application directory, create a Makefile with the following
text:

LIST=OS CPU VARIANT
MAKEFILE=GNUmakefile
include recurse.mk
##eof

Inside the same directory, create subdirectories called "nto-arm-le",
"nto-arm-le-v7", and "nto-x86-o", each containing a file called "GNUmakefile"
with this text:

ifndef QCONFIG
QCONFIG=qconfig.mk
endif
include $(QCONFIG)
include $(MKFILES_ROOT)/qmake-qt.mk
##eof

The application can be built for all QNX targets by running "make" at the top
level.  All standard qmake targets should work (e.g., "make install").

Optionally, a ksh script called "build-hook" can be placed at the top level; ...

Manual qmake invocation
-----------------------

qmake can also be executed manually; for example:
  "$QNX_HOST/usr/bin/qmake" -spec unsupported/qws/qnx-i386-g++

The following -spec options are available for QNX targets:
  unsupported/qws/qnx-arm-g++
  unsupported/qws/qnx-armv7-g++
  unsupported/qws/qnx-i386-g++


Re: Building examples  
This hasn't been tested.  But the project you mention is QML-based, and
there's nothing to build.  See
  $QNX_TARGET/usr/share/qt4/doc/html/qdeclarativeexamples.html

(qmlviewer should be able to run the example.)

-- Michael
Re: Building examples  
Thanks Michael.  Yes, I chose a bad example - no .cpp in that one.  I was wanting to build a project including qml 
combined with cpp files - which was why I chose 'declarative'.

I will find another example!

Dennis
Re: Building examples  
FYI - I was able to build/run the animation/moveblocks example on qnx6.5 by following the readme.txt...

1)   In the top-level application directory, create a Makefile with the following
text:

LIST=OS CPU VARIANT
MAKEFILE=GNUmakefile
include recurse.mk
##eof

2) Inside the same directory, create subdirectories called  "nto-x86-o" containing a file called "GNUmakefile" with this
 text:

ifndef QCONFIG
QCONFIG=qconfig.mk
endif
include $(QCONFIG)
include $(MKFILES_ROOT)/qmake-qt.mk
##eof

3) Run "make" at the top

4) Executable is in nto-x86-o directory

Re: Building examples  
FYI - I built/tested an example using QtCreator on Windows and moved the source file tree “as is” to 6.5.0 Neutrino 
self-hosted.

My example is declarative (GUI) with set/get methods implemented in C++.  This seems like one of the more difficult 
build scenarios to me... but certainly necessary to utilize device drivers to control something.

From the 6.5.0 freshly copied tree root...
# qmake –project
# qmake
# make

Had to add “-I/usr/include/qt4/QtDeclarative” to INCPATH and
-lQtDeclarative to LIBS in Makefile.   Surprisingly, those were the only changes... was expecting at lot more problems. 
( NOTE: I was building for x86 Neutrino)  

Looks like self-hosted build works pretty well!   The app (without using qmlviewer) runs on Neutrino exactly as it does 
on Windows, successfully setting/getting data from c++ extension as expected.

Note I have set the following in /root/.profile - for runtime use...
export QWS_DISPLAY=qnx
export QWS_KEYBOARD=qnx
export QWS_MOUSE_PROTO=qnx
export XDG_CONFIG_HOME=/root

I also started... 
# /usr/photon/bin/devi-hid -Pr kbd mouse
...prior to starting my program.   (Once devi-hid is started, you better have a console on serial or telnet as the 
console will no longer function in text mode.)