GithubHelp home page GithubHelp logo

Comments (3)

dtolnay avatar dtolnay commented on June 12, 2024 1

src/build.rs is the wrong location for a Cargo build script. It needs to be build.rs in the same directory that contains Cargo.toml. Or else you need to put build = "src/build.rs" into the Cargo.toml.

from cxx.

aohan237 avatar aohan237 commented on June 12, 2024

thanks

from cxx.

aohan237 avatar aohan237 commented on June 12, 2024

@dtolnay from doc https://docs.rs/cxx-build/1.0.98/cxx_build/static.CFG.html#cfginclude_prefix
`The prefix at which C++ code from your crate as well as directly dependent crates can access the code generated during this build.

By default, the include_prefix is equal to the name of the current crate. That means if your crate is called demo and has Rust source files in a src/ directory and maybe some handwritten C++ header files in an include/ directory, then the current crate as well as downstream crates might include them as follows:

// include one of the handwritten headers:
#include "demo/include/wow.h"

// include a header generated from Rust cxx::bridge:
#include "demo/src/lib.rs.h"

By modifying CFG.include_prefix we can substitute a prefix that is different from the crate name if desired. Here we’ll change it to "path/to" which will make import paths take the form "path/to/include/wow.h" and "path/to/src/lib.rs.h".`

what is the path/to means? it is not a absolute path. i tried.
so. the path/to means the same path as the build.rs located in ?

what is i have a cpp in src like detect as above, but it includes an opencv4 for example, like located in dir :
src/lib/opencv4
and other lib like
src/lib/thirdparty

how to include these libs? the tutorial has no example on this

i tried several ways, it shows that .h has no that file or dirs

from cxx.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.