I have downloaded FairPlay Streaming Server SDK, but it is written by C++, and I use golang as programming language, how can I integrate it? Thanks for your help.
Asked
Active
Viewed 148 times
1 Answers
0
You would need to write a wrapper in C, from which you can call your C++ SDK.
(example here)
Then using cgo, you can compile, linking to your SDK library.
See a concrete example in "Linking Dynamic C++ Libraries with Go" from Brand Aaron Taylor
Specifying the location of this file requires custom flags for the compiler command.
With a bit of searching I was able to find the-L
flag, which, similarly to the-I
flag, specifies a search directory for the compilation process as a whole.By specifying both Drafter’s build directory and dynamic library itself, we had a compiling C program!
gcc ctest.o -L./drafter/build/out/Release/ -ldrafter -o ctest

VonC
- 1,262,500
- 529
- 4,410
- 5,250