Comments (3)
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.
thanks
from cxx.
@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)
- Writing tests with CXX code causes linker issues
- Nonlocal extern "Rust" types trick in #942 doesn't work with Boxed types
- Raw identifiers in methods in extern "C++" block leads to wrong C++ code generation
- cxx::bridge behind a feature HOT 1
- Proposal: Implement Panic-to-Exception Handling Mode on FFI Boundary (Seeking Feedback)
- Can't figure out proper shim for UniquePtr instead of returning global singleton
- Compilation Issue: Linking to std in no_std Environment
- Compiling cdylib HOT 1
- Is it possible to mark a C++ type as `Trivial`? HOT 2
- Question: estimate workload to call functions from geogram HOT 1
- Returning `CxxString` from Rust to C++ HOT 2
- Extern C++ Enums HOT 5
- Advice/example on docs.rs strategy HOT 2
- Feature Request: Add support for nested Vector types HOT 1
- Building two CXX C++ bindings with the same symbols but in different namespaces. HOT 2
- Including bridge from another crate
- Error in configuring crates_universe when included as a Bazel module
- Error compiling `cxx.cc` on Windows HOT 1
- Proposal: implementing native C++ std::error_code
- Link failure when using CXX-backed function from another crate
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 cxx.