GTest installed with Conan: undefined reference

前端 未结 2 1852
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-12-18 05:26

I tried to use gtest installed through conan, but ended up with an undefined reference linker error. This question is a more or less a follow up to this stackoverflow questi

2条回答
  •  借酒劲吻你
    2020-12-18 05:32

    I ended up having to add self.options['gtest'].shared = True in the project's conanfile.py to get around this. Previously it was set to false for some windows-related reasons that became non-relevant.

    Try changing to shared libraries for gtest/gmock if, like me, you saw that the default settings were already libstdc++11 so changing the conan install args was not sufficient.

提交回复
热议问题