我想在Ubuntu 12.04上使用QtCreator IDE开发一些Qt应用程序 . 当我尝试构建最简单的项目时,我收到此错误:
/home/jerzu/QtTest/qt-test/mainwindow.ui:-1:error: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:Saxax错误:换行意外make:* [ui_mainwindow.h]错误2 17:23:26:进程“/ usr / bin / make”退出代码2.构建/部署项目时出错QtTest(工具包:Beagle-xM2)执行步骤'Make'
EDIT2:
1 回答
感谢您的支持,我终于解决了我的问题 . 就像Guilherme所说,这完全是关于环境设置......我不得不重新配置和更正一些Kit选项,特别是编译器路径,并选择好的
qmake
版本来处理我设置的每个编译器 .对这些的一些暗示,这将为BeagleBoard构建应用程序并使用
angstrom-linux-gnueabi
toolchain:直到你解雇QtCreator,你 MUST 运行
(...)/angstrom/arm/environment-setup
!然后,启动QtCreator FROM CONSOLE . 这是我为了获得适当的工作环境所必须做的 .关心jerzu