openimsdk / openim-sdk-cpp Goto Github PK
View Code? Open in Web Editor NEWIM SDK C/C++
License: Apache License 2.0
IM SDK C/C++
License: Apache License 2.0
[UPDATE]
It turned out that we cannot simply export the func contains go interface. We have to cast this “back and forth", that is, implementing a corresponding C++ interface, then passing the implemented functions to Go, then using the passed functions to implement the native Go interface, and finally exporting Go APIs to C++ as a .h file. The details are in the associated branch.
[STALE]
As in #1, the plan is to exporting go APIs into shared libraries that can be called by c++. Since there are many APIs, I'm starting with init_login to verify if this way works, then apply to other APIs.
Currently the challenge is exporting interface
type in Go, which is not explicitly documented in cgo.
No response
Some initial ideas about how to make sdk available in C++. There are several steps:
//export MyFunction
func MyFunction(arg1, arg2 int, arg3 string) int64 {...}
//export MyFunction2
func MyFunction2(arg1, arg2 int, arg3 string) (int64, *C.char) {...}
-buildmode=c-shared
to generete the C shared library with all dependencies built in.Reference:
https://medium.com/learning-the-go-programming-language/calling-go-functions-from-other-languages-4c7d8bcc69bf
https://pkg.go.dev/cmd/cgo#hdr-C_references_to_Go
No response
Now the Go functions such as InitSDK()
, Login()
are now avaible in .h
file. We need to test if they really work. If they are workable, we can begin to think about how to design the sdk package.
This step would involve starting the openim server, so there may be plenty of time spent on fixing environmental issue.
No response
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.