Gtest: Undefined References

后端 未结 3 1253
半阙折子戏
半阙折子戏 2020-12-31 00:14

I am trying to use GoogleTest to test a simple function, but as I run make in my build folder, the compiler throws Undefined Reference error messag

3条回答
  •  旧时难觅i
    2020-12-31 00:41

    From linker errors it is obvious that you did not link gtest library to your test program.

    See Primer:

    To write a test program using Google Test, you need to compile Google Test into a library and link your test with it. ...

    Just see this doc for details about your compiler and system.

提交回复
热议问题