C++ 在windows上编译qml材料时出错
如何在windows7机器上编译和安装 首先,我克隆并编译额外的cmake模块,如下所示:C++ 在windows上编译qml材料时出错,c++,qt,cmake,mingw,qml,C++,Qt,Cmake,Mingw,Qml,如何在windows7机器上编译和安装 首先,我克隆并编译额外的cmake模块,如下所示: git clone git://anongit.kde.org/extra-cmake-modules cd extra-cmake-modules mkdir build cd build cmake -G "MinGW Makefiles" .. 之后,我运行Make命令,但没有输出!(无错误,无更改!) 为了编译qml材料,我使用以下说明: mkdir build cd build cmake -
git clone git://anongit.kde.org/extra-cmake-modules
cd extra-cmake-modules
mkdir build
cd build
cmake -G "MinGW Makefiles" ..
之后,我运行Make
命令,但没有输出!(无错误,无更改!)
为了编译qml材料,我使用以下说明:
mkdir build
cd build
cmake -G "MinGW Makefiles" ..
但我得到了一个错误:
我试着用QtCreator编译ECM,然后qml材料,ECM编译和构建没有任何错误,但是qml材料也显示了上面的错误
谢谢,我将提供我的评论作为更好的概述的答案: 要使用它,实际上没有必要使用cmake“构建”项目,因为项目本身只包含普通的qml文件。 我不知道为什么这些家伙从qmake系统切换到cmake系统 但是,您只需将文件结构复制到本地文件系统:
- 使用
git clone签出项目https://github.com/papyros/qml-material.git
- 将
的内容复制到qml-material/modules/material
和Qt5.5.1/5.5/mingw/qml/material
中,其中qml-material/modules/QtQuick/Controls/style/material
代表您的Qt平台。也可以是mingw
或类似的内容gcc4.9
仅此而已。好吧,您实际上不需要“构建”qml材料。只需将普通的QML目录结构从复制到“Qt5.5.1/5.5/mingw/QML/Material”和从复制到“Qt5.5.1/5.5/mingw/QML/QtQuick/Controls/Styles/Material”@sk2212:谢谢你的评论,你真的帮我省了好几个小时的麻烦@不客气!也许我应该提供评论作为回答;-)?感谢您的回答,这是在windows构建上的工作,但不是在android上!这也应该适用于Android平台!您必须将
mingw
替换为android\u armv7
。你收到了什么错误消息?啊,谢谢你的评论,我也忘了复制到其他工具包,在android版本构建和运行成功后,一些图标丢失了。在QtCreator的编译输出结束时,您是否在pro文件中添加了svg
包?我也有这个问题。我通过在.svg
图标文件附近创建一个相应的.png
文件来修复它。我调整了qml材料的Icon.qml
组件,它将加载Android平台的png
图标和所有其他平台的svg
。
-- The C compiler identification is GNU 4.9.2
-- The CXX compiler identification is GNU 4.9.2
-- Check for working C compiler: C:/bin/cxx/Qt/Qt5.5.1/Tools/mingw492_32/bin/gcc.exe
-- Check for working C compiler: C:/bin/cxx/Qt/Qt5.5.1/Tools/mingw492_32/bin/gcc.exe -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: C:/bin/cxx/Qt/Qt5.5.1/Tools/mingw492_32/bin/g++.exe
-- Check for working CXX compiler: C:/bin/cxx/Qt/Qt5.5.1/Tools/mingw492_32/bin/g++.exe -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
CMake Error at C:/Users/me/Documents/Github/ecm/ECMConfig.cmake:35 (include):
include could not find load file:
C:/Users/me/share/ECM/modules//ECMUseFindModules.cmake
Call Stack (most recent call first):
CMakeLists.txt:13 (find_package)
CMake Error at CMakeLists.txt:16 (include):
include could not find load file:
KDEInstallDirs
CMake Error at CMakeLists.txt:17 (include):
include could not find load file:
KDECMakeSettings
CMake Error at CMakeLists.txt:18 (include):
include could not find load file:
KDECompilerSettings
CMake Error at tests/CMakeLists.txt:1 (include):
include could not find load file:
ECMMarkAsTest
CMake Error at tests/CMakeLists.txt:13 (ecm_mark_as_test):
Unknown CMake command "ecm_mark_as_test".
-- Configuring incomplete, errors occurred!