how to integrate fairplay license sdk by using golang?

167 Views Asked by At

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.

1

There are 1 best solutions below

0
VonC On

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