Comments (12)
Which version are you using?
from netcorehost.
rustc 1.57.0-nightly (e30b68353 2021-09-05)
cargo 1.56.0-nightly (18751dd3f 2021-09-01)
from netcorehost.
And what version of netcorehost?
from netcorehost.
netcorehost = "^0.3.1"
from netcorehost.
netcorehost = "^0.3.1"
path-absolutize = "3.0.10"
wchar = "0.10.1"
from netcorehost.
The bug should be fixed since 8978402 alongside #12. Try a version >= 0.5.0, 0.6.4 should be the best choice as its the newest.
from netcorehost.
tried 0.6.4 and 0.5.0 , below error
^^^^^^^^ expected enum c_void
, found ()
|
49 | hello(_pointer, 1)
| ^^^^^^^^ expected enum c_void
, found ()
|
= note: expected raw pointer *const c_void
found raw pointer *const ()
from netcorehost.
You probably only need to change some occurance of *const ()
to *const std::ffi::c_void
. You can also take a look at the updated examples.
from netcorehost.
i wanted to pass data to DLL
from netcorehost.
sample code
let c_string = CString::new("pass string".to_string()).expect("CString::new failed");
let ptr = c_string.into_raw();
let _pointer = ptr as *const ();
let result = unsafe {
hello(_pointer, 1)
};
from netcorehost.
worked after adding cstr = "0.2.8" to toml and keeping verison 0.3.0
from netcorehost.
You just need to replace the *const ()
with *const std::ffi::c_void
on the third line.
from netcorehost.
Related Issues (20)
- Load multiple functions with one AssemblyDelegateLoader crashes.
- could not find `u16cstr` in the list of imported crates HOT 3
- Initialization request is expected to be non-null for requests other than the first one HOT 4
- thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Hostfxr(Known(CoreHostLibMissingFailure))', HOT 2
- Building the project using the stable toolchain HOT 2
- Example on how to return a string from Dotnet HOT 2
- How to call something like Powershell from the CLR? HOT 6
- Use hostfxr_set_error_writer
- Can this library handle calling Rust code from managed code as well? HOT 3
- Executing from Bytes instead of from Disk HOT 4
- error: failed to run custom build command for `nethost-sys v0.5.1` HOT 6
- Error: proc-macro derive panicked HOT 4
- calling C# from Rust HOT 1
- Execution from multiple threads HOT 1
- Cross-compilation linking error for x86_64-pc-windows-gnu HOT 1
- Call rust functions using the extern keyword? HOT 1
- How to use initialize_for_dotnet_command_line_with_args with command line args? HOT 3
- Easier method of executing Rust code from C# HOT 2
- Why `and Delegate Loaded don't implement the send trait ? HOT 3
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 netcorehost.