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
make
Undefined Reference
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.