Results 1 to 3 of 3

Thread: qt creator and cross compiler

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2012
    Posts
    3
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default qt creator and cross compiler

    HI, is my first time using qt creator and I need to create a graphical interface to use in an Arm 11 board.
    I have installed in my Linux (Debian) the cross compiler and the arm-linux-gcc to compile my projects but my main problem is that I don't understand to configure the qt creator to compile using the cross compiler or arm-linux-gcc libreries.
    I red about qmake, cmake... but I don't know somethnig about this.
    I don't know if I have to reference the lib's, include's in the qt creator or if I have to put the ref's in the command line when I try to compile.
    Could somebdy explain me how to configure the qt creatorto compile the projects using cross compile and how to compile the projects?
    I red a lot of information but I don't understand because I'm very inexpert.
    Thanks very much.

    I find the Makefile in a project,
    CC = gcc
    CXX = g++
    DEFINES = -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED
    CFLAGS = -pipe -O2 -Wall -W -D_REENTRANT $(DEFINES)
    CXXFLAGS = -pipe -O2 -Wall -W -D_REENTRANT $(DEFINES)
    INCPATH = -I/usr/share/qt4/mkspecs/linux-g++ -I. -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtGui -I/usr/include/qt4 -I. -I. -I.
    LINK = g++

    and I edit this Makefile changing:

    CC = /usr/local/arm/4.3.2/bin/arm-linux-gcc
    CXX = /usr/local/arm/4.3.2/bin/arm-linux-g++
    DEFINES = -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED
    CFLAGS = -pipe -O2 -Wall -W -D_REENTRANT $(DEFINES)
    CXXFLAGS = -pipe -O2 -Wall -W -D_REENTRANT $(DEFINES)
    INCPATH = -I/usr/share/qt4/mkspecs/linux-g++ -I. -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtGui -I/usr/include/qt4 -I. -I. -I.
    LINK = /usr/local/arm/4.3.2/bin/arm-linux-g++


    and when I run make, the error output is:
    make: arm-linux-g++: Program not found
    Last edited by RAI32; 18th January 2012 at 11:37.

  2. #2
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: qt creator and cross compiler

    and when I run make, the error output is:
    make: arm-linux-g++: Program not found
    Which part of that error message is not clear? If the specified compiler cannot be found, or cannot be run, then you will not get far.

    Qt Creator simply runs qmake (or cmake) and then runs make. It is qmake that builds the Makefile. Have you built a version of Qt for embedded use? The qmake in that version should generate reasonable Makefiles and all you should have to do in Qt Creator is tell it to use that version of Qt.

  3. #3
    Join Date
    Jan 2012
    Posts
    3
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: qt creator and cross compiler

    Hi ChrisW67, first of all, thanks very much for your reply.
    I'm using a Debian distribution Linux and the Qt I'm using is the Qt installed by synaptic. I don't know if this Qt creator is the rigth way to develop software for an Arm embedded board. May be I need to use a Qtopia or a Qt4 embedded, but I don't know if those programs are the best option for my linux 2.6.36 and its rootfilesystems installed on the arm11 board.
    I searched in the web about my erros and I found any solutions. I saw that I have to modify the mkspecs, but I don't know the changes I have to do to compile the program with my cross compiler version.
    I made a qmake to create the Makefile and I modify this Makefile as show:


    ####### Compiler, tools and options

    CC = /usr/local/arm/4.2.2-eabi/usr/bin/arm-linux-gcc (modify to compile with my cross compiler)
    CXX = /usr/local/arm/4.2.2-eabi/usr/bin/arm-linux-g++ (modify to compile with my cross compiler)
    DEFINES = -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED
    CFLAGS = -pipe -O2 -Wall -W -D_REENTRANT $(DEFINES)
    CXXFLAGS = -pipe -O2 -Wall -W -D_REENTRANT $(DEFINES)
    INCPATH = -I/usr/share/qt4/mkspecs/linux-g++ -I. -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtGui -I/usr/include/qt4 -I. -I. -I.
    LINK = /usr/local/arm/4.2.2-eabi/usr/bin/arm-linux-g++ (modify to compile with my cross compiler)

    Now the compiler is found but there are a lot of errors:
    calculatorform.cpp: In constructor 'CalculatorForm::CalculatorForm(QWidget*)':
    calculatorform.cpp:53: error: 'QUiLoader' was not declared in this scope
    calculatorform.cpp:53: error: expected `;' before 'loader'
    calculatorform.cpp:55: error: 'QFile' was not declared in this scope
    calculatorform.cpp:55: error: expected `;' before 'file'
    calculatorform.cpp:56: error: 'file' was not declared in this scope
    calculatorform.cpp:56: error: 'QFile' is not a class or namespace
    calculatorform.cpp:57: error: 'loader' was not declared in this scope
    calculatorform.cpp:72: error: 'QVBoxLayout' was not declared in this scope
    calculatorform.cpp:72: error: expected type-specifier before 'QVBoxLayout'
    calculatorform.cpp:72: error: expected `;' before 'QVBoxLayout'
    calculatorform.cpp:73: error: invalid use of member (did you forget the '&' ?)
    calculatorform.cpp:73: error: base operand of '->' is not a pointer
    calculatorform.cpp:74: error: no matching function for call to 'CalculatorForm::setLayout(<unresolved overloaded function type>)'
    /usr/include/qt4/QtGui/qwidget.h:544: note: candidates are: void QWidget::setLayout(QLayout*)
    .
    .
    .
    I don't know how to configure the qt creator to take into account the includes and lib's availables in the linux 2.6.36 filesystems directories presents in the arm 11 board.

Similar Threads

  1. Cross-compiler Qt4 app from ubuntu to windows xp
    By tiho_bg in forum Qt Programming
    Replies: 3
    Last Post: 1st December 2011, 17:52
  2. change compiler for cross compiling
    By Mr Bean in forum Qt for Embedded and Mobile
    Replies: 0
    Last Post: 17th February 2011, 13:35
  3. problems with making cross compiler
    By nataly in forum Qt for Embedded and Mobile
    Replies: 2
    Last Post: 15th December 2009, 06:44
  4. Qt Embedded cross compiler make fails
    By quado player in forum Installation and Deployment
    Replies: 0
    Last Post: 1st September 2009, 14:22
  5. Cross compiler in Linux
    By vincat in forum Qt Programming
    Replies: 1
    Last Post: 11th June 2009, 07:14

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.