c++ - Can STL be made completely inline? -
we using third-party library in our visual studio 2013 c++ project. library guess uses different stl library ours. getting link errors. there no compile-time errors. understand, stl template-based code requiring no linking. looks there parts of stl require linking stl library. wondering if there way force stl inline. regards.
there no single answer question. in general, c++ known not "link-compatible" (or "binary compatible") between different versions of compilers (or different brands of compilers, etc, etc). supplying library should specify compiler expect used, , user of library need use one. [i've seen problems using same version, 2 different "builds" of compiler]
to possibly find solution, you'd have @ compiler/linker attempting find, , see if function @ present in sources stl - if is, possibly applying liberal sprinkling (on relevant functins) of "always_inline" or whatever particular compiler uses functionality. chances functions you're missing aren't provided in header files in first place. of course assumes have source library, can recompiled [or can convince provider recompile new settings].
and you'll potentially still have problems things implementation dependent (the problem "same version, different build" mentioned above wrote stl implementation decided change constructor parameter "unsigned int" "size_t" @ point, [could change or] changes size of data passed constructor -> not behaving same when call function [but shared library loader detects , refuses load executable/shared library combination]
[as lightness races in orbit says, above applies "standard template library", things std::vector
, std::map
, std::random
, many other things, not include of runtime functionality required write non-trivial c++ program]
Comments
Post a Comment