构建 qwt-6.1 中的错误“缺少分隔符”

Posted

技术标签:

【中文标题】构建 qwt-6.1 中的错误“缺少分隔符”【英文标题】:error "missing separator" in build qwt-6.1 【发布时间】:2013-05-15 14:27:31 【问题描述】:

我的环境:

QT: Qt_5_0_2
QWT: qwt-6.1-rc3
MinGW: mingw47_32
OS: win7_32

我按照介绍文件“INSTALL”的步骤:

C) Win32/MinGW 
Check that your Qt version has been built with MinGW - not with MSVC !

Start a Shell, where Qt4 is initialized. ( F.e. with
"Programs->Qt by Trolltech ...->Qt 4.x.x Command Prompt" ).
Check if you can execute "make" or something like "mingw32-make".

qmake qwt.pro
make
make install

我在“make”步骤中遇到错误:

C:\qwt-6.1-rc3>qmake qwt.pro

C:\qwt-6.1-rc3>mingw32-make
cd src\ && ( if not exist Makefile E:\Qt\5.0.2\5.0.2\mingw47_32\bin\qmake.exe C:
\qwt-6.1-rc3\src\src.pro -o Makefile ) && mingw32-make -f Makefile
mingw32-make[1]: Entering directory 'C:/qwt-6.1-rc3/src'
mingw32-make -f Makefile.Release all
mingw32-make[2]: Entering directory 'C:/qwt-6.1-rc3/src'
Makefile.Release:305: *** missing separator.  Stop.
mingw32-make[2]: Leaving directory 'C:/qwt-6.1-rc3/src'
Makefile:40: recipe for target 'release-all' failed
mingw32-make[1]: *** [release-all] Error 2
mingw32-make[1]: Leaving directory 'C:/qwt-6.1-rc3/src'
makefile:44: recipe for target 'sub-src-make_first-ordered' failed
mingw32-make: *** [sub-src-make_first-ordered] Error 2

“Makefile.Release”中的304,305行是:

304 qmake:  FORCE
305     @$(QMAKE) -o Makefile.Release src.pro

哪里错了?

谢谢

【问题讨论】:

This is probably a formatting error。如果您删除 makefile 并从第 1 步重新开始,是否会发生这种情况? 我发现我可以在 QTCreator 中成功构建 QWT。但我不知道如何将 QWT 集成到 QTCreator。谢谢。 【参考方案1】:
Makefile.Release:305: *** missing separator.  Stop.

这通常意味着Makefile 的格式不适合mingw32-make

由于Makefile 是由qmake 生成的,因此您应该检查qmakeQMAKESPEC。应该是win32-g++,而不是win32-mvsc

此问题与qwt INSTALL 的第一个警告密切相关:

检查您的 Qt 版本是用 MinGW 构建的 - 而不是 MSVC!

【讨论】:

我的 Qt 是从“qt-windows-opensource-5.0.2-mingw47_32-x86-offline.exe”安装的。我在“Qt 5.0.2 for Desktop (MinGW 4.7)”命令行中运行“make”。这是否意味着我的 Qt 是使用 MSVC 构建的?【参考方案2】:

猜猜你损坏的 Makefile 是早期尝试遗留下来的 - 完全删除 Qwt 构建目录并从头开始。

要在 Qt 创建器中加载 Qwt 设计器插件,您需要一个与创建器构建方式兼容的版本。 AFAIR 5.0.2 mingw 包包含一个 2.7.0 版本的创建者,它是为 Qt 4.8 和 MSVC 构建的(请参阅 About->Qt creator )。如果为 true,则意味着您需要 2 个不同的 Qwt 版本 - 一个用于您的应用程序,另一个用于设计器插件。

对于未来,我计划提供与当前 Qt 创建器的二进制包兼容的设计器插件的预编译版本。

另请注意,在 SVN 主干中,自 rc3 以来构建插件的默认设置已更改:在 Windows 上,库静态链接到插件中,而在更好的系统上,在库的安装路径中编译也有类似的效果(见 RPATH)。

【讨论】:

我找到了另一种方式qtcentre.org/archive/index.php/t-36498.html 来构建qwt: 1.qmake.exe qwt.pro -spec win32-g++ -r CONFIG+=release 2.mingw32-make release 3.mingw32-make install 另一个问题:如何告诉我的 Qt creator 是为 MSVC 构建的? About->Qt creator 中的信息是“ Qt Creator 2.7.0 Based on Qt 5.0.2 (32 bit) Built on Apr 9 2013 at 09:32:03 From revision b6257ef735 Copyright 2008-2013 Digia Plc. 保留所有权利。该程序按原样提供,不提供任何形式的保证,包括对设计、适销性和特定用途适用性的保证。"【参考方案3】:

我遇到了同样的问题。原因是我想第二次准备资源。我在 svn floder 中有资源。我解决了擦除文件夹并再次更新源的问题。完成此操作后,我能够正确运行“qmake proj.pro”。

【讨论】:

以上是关于构建 qwt-6.1 中的错误“缺少分隔符”的主要内容,如果未能解决你的问题,请参考以下文章

出错:缺少分隔符

*** 缺少分隔符会出错

makefile:4: *** 缺少分隔符。停止

make命令makefile出错:18:***缺少分隔符。停止

Makefile:2: *** 缺少分隔符。停止。我该如何解决这个问题我是 Raylib for C++ 的新手

熊猫:用缺少分隔符分隔两列[关闭]