GithubHelp home page GithubHelp logo

draffensperger / go-interlang Goto Github PK

View Code? Open in Web Editor NEW
418.0 418.0 62.0 2.38 MB

Examples of calls between Go and C/C++ (and how to call a Go shared object from Node/Ruby/Python/Java)

C 24.53% Go 34.18% C++ 6.51% Java 2.92% JavaScript 0.80% Python 1.25% Ruby 6.02% Makefile 9.12% Shell 14.68%
cgo ffi golang swig

go-interlang's Issues

GO binding struct for a self referencing struct

Hi,

Any ideas on how to write a golang equivalent struct for self referencing struct something like this -

typedef struct WRITER {
int version;
int (WriteBlock)(struct WRITER thisPtr,
const void* dataBufferPtr,
unsigned long bufferSize);
} WRITER;

Thanks.

external c library

Hi,
do you know how I can call and link an external c/c++ library in callback or adder?
I can call from the main, but not in the .c/.h files of the callback project.
Thanks a lot
Angelo

Compile error: I can't call exported go function in C++

I followed your example in cxx_to_go_dyn_lib. I want to export go functions in infiniband go module so that they are callable from C++. I manage to generate the .h header files but when I compile my C++ code it bumps out with the following error:

./src/github.com/jsgilmore/ib/libadder.so(_all.o): In function Initialize': /tmp/go-build/github.com/jsgilmore/ib/_obj/_cgo_export.c:33: undefined reference to _cgo_wait_runtime_init_done'
/tmp/go-build/github.com/jsgilmore/ib/_obj/_cgo_export.c:38: undefined reference to `_cgoexp_1f5f6ba4e969_Initialize'

Didn't get much help from the internet on this error. I will appreciate your input.
P.S. The file that contains the the exported go functions has an "import C" declaration with commented includes. Could this be an issue?

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.