0

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.

Garkett
  • 19
  • 4

1 Answers1

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