0

I'd like to use the AWS C++ SDK in a C library. However, the library build only supports C++.

Does anyone know if there's a C wrapper for the SDK ? There are far too many methods to easily change the code.

Or should I just call the mangled methods (not portable) ?

garyM
  • 802
  • 2
  • 12
  • 29
  • The library is too big and the C++ objects the methods require as parameters are too complex to build a wrapper. You will have better luck using the http API directly through libcurl, most aws-sdk-c++ APIs internally use it. – gabry Aug 31 '18 at 10:17

1 Answers1

0

You can write a wrapping C++ code, which wraps the library, and export the main methods in 'C' mangling. using 'extern "C"' at the functions decelerations. I've writtend such a wrapper for having s3 client, having methods to create/destroy s3 client/transfer client, and upload/download a file (code is company proprietary so I can't share it).

I think this is better than implementing the http api using curl, as writing your own client is complex, and you may want other features (and bug fixes) which you get out of the box if you use the sdk (such as using kms,recovery handling etc.)

Eliyahu Machluf
  • 1,251
  • 8
  • 17