语法错误:换行意外 - QtCreator

时间:2013-12-16 11:22:06

标签: c++ qt ubuntu-12.04 qt-creator

我想在Ubuntu 12.04上使用QtCreator IDE开发一些Qt应用程序。当我尝试构建最简单的项目时,我收到了这个错误:

  

/home/jerzu/QtTest/qt-test/mainwindow.ui:-1:错误:2:   ../qt-test/mainwindow.ui:语法错误:换行意外

当我使用命令行(qmake2 ProjectName.pro命令)时,一切顺利。我确信QtCreator中的qmake路径是正确的。

你知道吗,发生了什么事?

编辑:

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>

输出行

  

17:23:26:为项目QtTest运行步骤......   17:23:26:配置不变,跳过qmake步骤。   17:23:26:开始:“/ usr / bin / make”   ../QtTest/mainwindow.ui -o ui_mainwindow.h   ../QtTest/mainwindow.ui:2:../QtTest/mainwindow.ui:语法错误:换行意外   make: * [ui_mainwindow.h]错误2   17:23:26:进程“/ usr / bin / make”退出代码2。   构建/部署项目QtTest时出错(工具包:Beagle-xM2)   执行步骤'Make'时

EDIT2:

生成文件:

http://shrib.com/CBm2rKJV

1 个答案:

答案 0 :(得分:1)

感谢您的支持,我终于解决了我的问题。就像Guilherme所说,这完全是关于环境设置...我必须重新配置和更正一些Kit选项,尤其是编译器路径,并选择好的qmake版本来处理我设置的每个编译器。

对这些内容的一些暗示,它将为BeagleBoard构建应用程序并使用angstrom-linux-gnueabi工具链:

在你解雇QtCreator之前,你必须运行(...)/angstrom/arm/environment-setup!然后,启动QtCreator FROM CONSOLE 。这是我必须做的才能获得适当的工作环境。

此致 耶尔祖

相关问题