Git Product home page Git Product logo

Comments (5)

caesarchad avatar caesarchad commented on June 1, 2024

need to investigate reason not working on ubuntu 18.04?

possible workaround:

  • use urfave cli to parse the argument, then send the parameters to rust code

  • use another cli parser to replace Clap.

  • tweek the env and go build (possible different go compiler)

from bitconch-core.

caesarchad avatar caesarchad commented on June 1, 2024

possible workaround:

created a new branch fixissue85

1 - modify sources accept argument from go side.
2 - string passed to rust code like

#[no_mangle]
pub extern "C" fn hello(parm1: *const libc::c_char, parm2: *const libc::c_char) {
    let buf_parm1 = unsafe { CStr::from_ptr(parm1).to_bytes() };
    let str_parm1 = String::from_utf8(buf_parm1.to_vec()).unwrap();
    if !str_parm1.is_empty(){
      //pass the value from str_parm1}else{
      //pass the default value}
}

3 - modify c header file

void void hello(char *parm1, char *parm2);

4 - modfiy go file

func AGoFunction(parm1 string, parm2 string ){
cStr_1 := C.CString(parm1)
cStr_2 := C.CString(parm2)
C.hello(cStr_1,cStr_2)

}

from bitconch-core.

caesarchad avatar caesarchad commented on June 1, 2024

possible workaround

1 - replace gccgo/gc with llgo
building in progress...
2 - use gccgo

from bitconch-core.

caesarchad avatar caesarchad commented on June 1, 2024

as for commit adc878c,
this issue has been fixed: implementing urfave to accept arguments

from bitconch-core.

caesarchad avatar caesarchad commented on June 1, 2024

Close

from bitconch-core.

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.