Skip to content

compat.opencv编译链接报错 #252

Description

@tz12323

系统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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions