Runtime Issues While Mixing Libraries from Different Versions of Visual Studio

后端 未结 2 482
甜味超标
甜味超标 2021-01-06 04:41

I have encountered an unexpected Access Error while running a project I\'ve built using two different versions of Visual Studio. My general configuration is as follows:

2条回答
  •  臣服心动
    2021-01-06 05:24

    You can't use different STL implementation in the same project. This means even different versions from the same compiler. If your LibA has a function that accepts std::vector as an argument you are only allowed to pass vector object from STL that LibA was built with. This is why many C++ libraries expose only C API.

    Either you change your API or you rebuild all your projects using the same compiler.

    You are doing something that you shouldn't. You are in the world of undefined behavior. There is no point in trying to debug this particular crash. Even if you managed to make this line work you would get a new crash somewhere else.

提交回复
热议问题