Increase Propagation with a Closed Source Library

I have an application that should use a specific closed C ++ API. This API is distributed with some bits of Boost files, a binary library and all. I like to use Boost in my own code. I can't just use their version of Boost, since they did not distribute all the parts of Boost that I need. How do I proceed? The target platform is Linux, ultimately Windows.

  • I will not pass Boost objects across the API border.
  • I can compile objects into object files so that my code uses my header headers and the API code uses Boost headers. This part seems simple.
  • What I am not getting: how to link my code with my Boost library files and the API code in its Boost library files. Do I need to compile my own wrapper around an API - a wrapper whose headers do not include Boost - in a dynamic library? (This is the only way I can make up a link. The characters in the Boost API library files should be identical to the characters in my Boost library files. I have to make the link in two steps, no? The only way I can link one part of the program without the rest, creating a dynamic library, no?)
+7
source share
3 answers

A given executable file can have only one piece of code for each character. Therefore, if their library uses the foo character from boost v. 1, and you use the same character from boost v. 2, then you will get a collision. There is no easy way to get rid of this collision without changing the symbol. It should be possible to use dynamic execution if you could compile the raise code into a dynamic library but it seems like this would be redundant.

Since in C ++ a character is distorted with its class / namespace, you can also change one of them to change the character.

+1
source

If you use only advanced header libraries, you can simply create your code separately from code that references other libraries.

What acceleration libraries do you use?

0
source

How is api link used with boost library? Do they deploy boost - ##, so is it with it, or was it statically linked?

So run "objdump -T api.so | grep boost" in your api.so to check if api shows Boost.

It is also possible that they renamed the boost namespace, as mentioned by the user chrisaycock. Use the C ++ filt command to take a closer look at the characters found with "objdump -T api.so | grep boost".

If it was statically linked and the promotion symbols were not open (or were renamed), then you can use boost in your code without raising the API.

If boost is really exposed, I recommend just trying boost. For your code that uses boost, there may not be a collision. If this happens, you can compile a new impulse and change the namespace name. Just run the replacement-all script, replacing the "namespace extension" with something like "namespace boost_1_46".

0
source

All Articles