系统win11 源代码src/main.cpp ``` // test_opencv — generated by `mcpp new` import std; #include <opencv2/opencv.hpp> int main(int argc, char* argv[]) { std::println("Hello from test_opencv!"); std::println("Built with import std + std::println on modular C++23."); if (argc > 1) { for (int i = 1; i < argc; ++i) std::println(" arg[{}] = {}", i, argv[i]); } return 0; } ``` mcpp.toml ``` [package] name = "test_opencv" version = "0.1.0" description = "A modular C++23 package" license = "Apache-2.0" [dependencies] compat.opencv = "5.0.0" ``` mcpp运行编译报错 ``` mcpp build PS D:\bianchen\c\test_opencv> mcpp build Resolving toolchain Resolved llvm@20.1.7 → @mcpp/registry/data/xpkgs/xim-x-llvm/20.1.7/bin/clang++.exe build.mcpp compiling build.mcpp running warning: D:\cbuild\registry\data\xpkgs\compat-x-compat.opencv\5.0.0: [build].flags glob '**/3rdparty/mlas/**' matched no source file warning: D:\cbuild\registry\data\xpkgs\compat-x-compat.opencv\5.0.0: [build].flags glob '**/clsrc/opencl_kernels_core.cpp' matched no source file warning: D:\cbuild\registry\data\xpkgs\compat-x-compat.opencv\5.0.0: [build].flags glob '**/clsrc/opencl_kernels_geometry.cpp' matched no source fi le warning: D:\cbuild\registry\data\xpkgs\compat-x-compat.opencv\5.0.0: [build].flags glob '**/clsrc/opencl_kernels_imgproc.cpp' matched no source fil e warning: D:\cbuild\registry\data\xpkgs\compat-x-compat.opencv\5.0.0: [build].flags glob '*/3rdparty/mlas/lib/platform.cpp' matched no source file Inferred sources [src/**/*.{cppm,cpp,cc,c,S,s,asm}] Inferred target test_opencv (bin from src/main.cpp) Compiling test_opencv v0.1.0 (.) Compiling compat.opencv v5.0.0 Finished release [optimized] in 97.81s ```
Activity
Sunrisepeak commentedon Jul 20, 2026
这个是警告应该不影响使用
tz12323 commentedon Jul 21, 2026
并非如此
mcpp build没有报错
但是mcpp run直接报错
Sunrisepeak commentedon Jul 21, 2026
目前正重新拉上游基于上游进行修复
Sunrisepeak commentedon Jul 22, 2026
@tz12323 更新已经合入, 可以
mcpp new myopencv --template opencv来创建 模板工程, mcpp run 已经可以运行Sunrisepeak commentedon Jul 22, 2026
现在可以用 import 来导入, 如果还有遇到问题再reopen
https://github.com/Sunrisepeak/opencv-m