Passing reference to STL vector over dll boundary

前端 未结 7 1871
一个人的身影
一个人的身影 2020-12-01 08:02

I have a nice library for managing files that needs to return specific lists of strings. Since the only code I\'m ever going to use it with is going to be C++ (and Java but

7条回答
  •  鱼传尺愫
    2020-12-01 08:44

    You are probably running into binary compatibility issues. On windows, if you want to use C++ interfaces between DLLs you have to make sure that a lot of things are in order, for ex.

    • All DLLs involved must be built with the same version of the visual studio compiler
    • All DLLs have to have link the same version of the C++ runtime (in most versions of VS this is the Runtime Library setting under Configuration -> C++ -> Code Generation in the project properties)
    • Iterator debugging settings have to be the same for all builds (this is part of the reason you can't mix Release and Debug DLL's)

    That's not an exhaustive list by any stretch unfortunately :(

提交回复
热议问题