Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Syntax error: newline unexpected - QtCreator

I want to develop some Qt applications with QtCreator IDE on Ubuntu 12.04. When I'm trying to build even the most simple project, I get this error:

/home/jerzu/QtTest/qt-test/mainwindow.ui:-1: error: 2: ../qt-test/mainwindow.ui: Syntax error: newline unexpected

And when I'm using command line (qmake2 ProjectName.pro command), everything goes well. I'm sure that the qmake path in QtCreator is correct.

Have you any idea, what's going on?

EDIT:

mainwindow.ui

<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
 <class>MainWindow</class>
 <widget class="QMainWindow" name="MainWindow">
  <property name="geometry">
   <rect>
    <x>0</x>
    <y>0</y>
    <width>400</width>
    <height>300</height>
   </rect>
  </property>
  <property name="windowTitle">
   <string>MainWindow</string>
  </property>
  <widget class="QWidget" name="centralWidget"/>
  <widget class="QMenuBar" name="menuBar">
   <property name="geometry">
    <rect>
     <x>0</x>
     <y>0</y>
     <width>400</width>
     <height>25</height>
    </rect>
   </property>
  </widget>
  <widget class="QToolBar" name="mainToolBar">
   <attribute name="toolBarArea">
    <enum>TopToolBarArea</enum>
   </attribute>
   <attribute name="toolBarBreak">
    <bool>false</bool>
   </attribute>
  </widget>
  <widget class="QStatusBar" name="statusBar"/>
 </widget>
 <layoutdefault spacing="6" margin="11"/>
 <resources/>
 <connections/>
</ui>

output line

17:23:26: Running steps for project QtTest... 17:23:26: Configuration unchanged, skipping qmake step. 17:23:26: Starting: "/usr/bin/make" ../QtTest/mainwindow.ui -o ui_mainwindow.h ../QtTest/mainwindow.ui: 2: ../QtTest/mainwindow.ui: Syntax error: newline unexpected make: * [ui_mainwindow.h] Error 2 17:23:26: The process "/usr/bin/make" exited with code 2. Error while building/deploying project QtTest (kit: Beagle-xM2) When executing step 'Make'

EDIT2:

Makefile:

http://shrib.com/CBm2rKJV

like image 433
jerzu Avatar asked Dec 16 '13 11:12

jerzu


1 Answers

Thanks for your support, I've finally resolved my problem. Like Guilherme said, it was all about environment setup... I had to reconfigure and correct some Kit options, especially compilers paths, and choose good version of qmake to work with every single compiler I set.

Little hint for these, which would build applications for BeagleBoard and use angstrom-linux-gnueabi toolchain:

Until you fire QtCreator, you MUST run (...)/angstrom/arm/environment-setup! And then, start QtCreator FROM CONSOLE. This is what I had to do to get properly working environment.

Regards jerzu

like image 141
jerzu Avatar answered Oct 11 '22 15:10

jerzu