Sunday, December 15, 2024
HomeiOS Developmentios - Cannot use a number of C++ recordsdata in Swift Bundle

ios – Cannot use a number of C++ recordsdata in Swift Bundle


I need to construct a swift package deal which additionally makes use of code from c++ , so the issue I’m going through is I can construct and use one single c++ file , however after I add a number of c++ file it reveals file not discovered. Because the screenshot describes this extra.

My swift package deal file –

// swift-tools-version: 5.10
import PackageDescription

let package deal = Bundle(
    title: "AVTPG_Module",
    merchandise: [
        // Products define the executables and libraries a package produces, making them visible to other packages.
        .library(
            name: "AVTPG_Module",
            targets: ["AVTPG_Module"]
        ),
    ],
    targets: [
        // Targets are the basic building blocks of a package, defining a module or a test suite.
        .target(
            name: "CppModule",
            path: "Sources/CppModule",
            cxxSettings: [
                .headerSearchPath("include")
            ]
        ), // <- Add a comma right here
        .goal(
            title: "AVTPG_Module",
            dependencies: ["CppModule"],
            swiftSettings: [.interoperabilityMode(.Cxx)]
        ),
        .testTarget(
            title: "AVTPG_ModuleTests",
            dependencies: ["AVTPG_Module"]
            
        ),
    ]
)

Screenshot –
enter image description here

I need to use a number of c++ file in my swift package deal.

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

Recent Comments