Comments (3)
demo 已更新 e6e73fa
主要是 demo 是工程外部的,所以没去测试到,然后就忘了有这回事。。。
from ugm.
对于问题 3,不清楚
不过这么简单的cmake例子,不大可能出错
从你发的 log 也看不大出问题
from ugm.
对于问题 3,不清楚 不过这么简单的cmake例子,不大可能出错 从你发的 log 也看不大出问题
好的,非常感谢大佬!
关于问题三,我刚刚又尝试了一下.
我使用的是MinGw 11.2.0,CMake版本是3.21.1,操作系统是win10.
在demo文件夹内,使用Git Bash运行cmake时指定编译套件为"MinGw Makefiles".
zyk@DESKTOP-HLNE1FE MINGW64 /e/lib/UGM/demo (master)
$ cmake -B build -G "MinGW Makefiles"
-- The C compiler identification is GNU 11.2.0
-- The CXX compiler identification is GNU 11.2.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: D:/QT/Tools/mingw1120_64/bin/gcc.exe - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: D:/QT/Tools/mingw1120_64/bin/g++.exe - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- config UGM 0.7.6...
-- find package: UCMake 0.6.4
-- config UCMake 0.6.4 ...
-- include UbpaInit.cmake
-- include UbpaBasic.cmake
-- include UbpaBuild.cmake
-- include UbpaDownload.cmake
-- include UbpaGit.cmake
-- include UbpaPackage.cmake
-- include UbpaQt.cmake
-- config UCMake 0.6.4 done
-- start add dependence UTemplate 0.7.2
-- find package: UTemplate 0.7.2
-- config UTemplate 0.7.2...
-- config UTemplate 0.7.2 done
-- UTemplate 0.7.2 found
-- config UGM 0.7.6 done
-- Configuring done
-- Generating done
-- Build files have been written to: E:/lib/UGM/demo/build
zyk@DESKTOP-HLNE1FE MINGW64 /e/lib/UGM/demo (master)
$ cmake --build build --verbose
D:\QT\Tools\CMake_64\bin\cmake.exe -SE:\lib\UGM\demo -BE:\lib\UGM\demo\build --check-build-system CMakeFiles\Makefile.cmake 0
D:\QT\Tools\CMake_64\bin\cmake.exe -E cmake_progress_start E:\lib\UGM\demo\build\CMakeFiles E:\lib\UGM\demo\build\\CMakeFiles\progress.marks
D:/QT/Tools/mingw1120_64/bin/mingw32-make.exe -f CMakeFiles\Makefile2 all
mingw32-make.exe[1]: Entering directory 'E:/lib/UGM/demo/build'
D:/QT/Tools/mingw1120_64/bin/mingw32-make.exe -f CMakeFiles\demo.dir\build.make CMakeFiles/demo.dir/depend
mingw32-make.exe[2]: Entering directory 'E:/lib/UGM/demo/build'
D:\QT\Tools\CMake_64\bin\cmake.exe -E cmake_depends "MinGW Makefiles" E:\lib\UGM\demo E:\lib\UGM\demo E:\lib\UGM\demo\build E:\lib\UGM\demo\build E:\lib\UGM\demo\build\CMakeFiles\demo.dir\DependInfo.cmake --color=
mingw32-make.exe[2]: Leaving directory 'E:/lib/UGM/demo/build'
D:/QT/Tools/mingw1120_64/bin/mingw32-make.exe -f CMakeFiles\demo.dir\build.make CMakeFiles/demo.dir/build
mingw32-make.exe[2]: Entering directory 'E:/lib/UGM/demo/build'
[ 50%] Building CXX object CMakeFiles/demo.dir/main.cpp.obj
D:\QT\Tools\mingw1120_64\bin\g++.exe @CMakeFiles/demo.dir/includes_CXX.rsp /fp:fast /permissive- /wd4201 -std=gnu++20 -MD -MT CMakeFiles/demo.dir/main.cpp.obj -MF CMakeFiles\demo.dir\main.cpp.obj.d -o CMakeFiles\demo.dir\main.cpp.obj -c E:\lib\UGM\demo\main.cpp
g++.exe: fatal error: cannot specify '-o' with '-c', '-S' or '-E' with multiple files
compilation terminated.
mingw32-make.exe[2]: *** [CMakeFiles\demo.dir\build.make:76: CMakeFiles/demo.dir/main.cpp.obj] Error 1
mingw32-make.exe[2]: Leaving directory 'E:/lib/UGM/demo/build'
mingw32-make.exe[1]: *** [CMakeFiles\Makefile2:82: CMakeFiles/demo.dir/all] Error 2
mingw32-make.exe[1]: Leaving directory 'E:/lib/UGM/demo/build'
mingw32-make.exe: *** [Makefile:90: all] Error 2
具体的错误步骤是在这一步
D:\QT\Tools\mingw1120_64\bin\g++.exe @CMakeFiles/demo.dir/includes_CXX.rsp /fp:fast /permissive- /wd4201 -std=gnu++20 -MD -MT CMakeFiles/demo.dir/main.cpp.obj -MF CMakeFiles\demo.dir\main.cpp.obj.d -o CMakeFiles\demo.dir\main.cpp.obj -c E:\lib\UGM\demo\main.cpp
并且经过我另开项目的反复测试,只要在项目的CMakeLists.txt中添加
find_package(UGM REQUIRED)
add_executable(XXX main.cpp)
target_link_libraries(XXX PUBLIC Ubpa::UGM_core)
不管是否真的引用了UGM中的内容,都会报与上面相同的错误.
当然上面的错误仅在使用了-G MinGw Makefiles
与-G Ninja
(只测试了这两个)才会出现,在windows系统中默认的cmake构建套件是MSVC compiler 并不会出现这些错误.
from ugm.
Related Issues (5)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ugm.