Giter Site home page Giter Site logo

Comments (12)

OpenByteDev avatar OpenByteDev commented on September 13, 2024

Which version are you using?

from netcorehost.

ArunGust avatar ArunGust commented on September 13, 2024

rustc 1.57.0-nightly (e30b68353 2021-09-05)
cargo 1.56.0-nightly (18751dd3f 2021-09-01)

from netcorehost.

OpenByteDev avatar OpenByteDev commented on September 13, 2024

And what version of netcorehost?

from netcorehost.

ArunGust avatar ArunGust commented on September 13, 2024

netcorehost = "^0.3.1"

from netcorehost.

ArunGust avatar ArunGust commented on September 13, 2024

netcorehost = "^0.3.1"
path-absolutize = "3.0.10"
wchar = "0.10.1"

from netcorehost.

OpenByteDev avatar OpenByteDev commented on September 13, 2024

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.

ArunGust avatar ArunGust commented on September 13, 2024

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.

OpenByteDev avatar OpenByteDev commented on September 13, 2024

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.

ArunGust avatar ArunGust commented on September 13, 2024

i wanted to pass data to DLL

from netcorehost.

ArunGust avatar ArunGust commented on September 13, 2024

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.

ArunGust avatar ArunGust commented on September 13, 2024

worked after adding cstr = "0.2.8" to toml and keeping verison 0.3.0

from netcorehost.

OpenByteDev avatar OpenByteDev commented on September 13, 2024

You just need to replace the *const () with *const std::ffi::c_void on the third line.

from netcorehost.

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.