-
Notifications
You must be signed in to change notification settings - Fork 159
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Simple C++ Header file missing half of the elements in conversion #858
Comments
Am I correct in those manual conversion?
towards Go
|
Those look like forward declarations (the functions have an missing body) - there is no equivalent of this in Go. You should be transpiling your C files, not the header files. |
The only way for me to get rid of C++ and use Golang to build DLL/SO is to be able to port this header file can you help out? This is the only header I need to switch my whole environment. I don't fully understand Golang deepness to be able to achieve that |
It sounds like you need to use cgo which will let you link your go code against compiled C++ code. This project, c2go, is a transpiler tool that attempts to convert C source code itself to Go code. It also does not support C++ source code. |
I am writting many of those small libraries for speed purpose because C++ is really fast. Actually my goal was to ditch C++ completely and use Golang to just write those DLLs and use the exports so that the VM recognize the initial functions and load those DLLs and make them available at runtime. This is an example of a really simple C++ Native Extension for Adobe AIR VM : https://github.com/StackAndHeap/joystick-ane/blob/master/native/win/JoystickManager/JoystickManager/JoystickANE.c As you can see it exports few functions like: Here comes the initialization: Finalization: 2 simple exported function which are called by the VM when loaded Do you still think that it will be impossible to achieve all that within Golang? Thank you for your support. |
@al-sabr I can't speak to what you should or shouldn't do, but you have two options:
|
On Windows 10
Will result to :
Half of the functions are missing
The text was updated successfully, but these errors were encountered: