Open yurivict opened 4 months ago
It sounds like you are confusing gtest_main
, which is a build target, and gtest_main.so
, which is a shared object file. If you are using a supported build system (Bazel, CMake), the build target should transitively link everything, including gtest
, necessary when linking gtest_main
. The so
file itself will not contain anything but main
. However, you should not rely on transivitivty. If you directly use a symbol, you should specify the corresponding dependency. And don't refer to .so
files at all. Let a build system figure that part out for you.
Several projects just link with -lgtest_main and it works somehow in some cases, and doesn't work in other cases.
Describe the issue
gtest_main.so built by the FreeBSD port doesn't contain symbols normally found in gtest.so
Is
gtest_main.so
documented anywhere? Is it supposed to only have themain
symbol, or also all symbols fromgtest.so
?This post says:
It isn't clear what does it mean "gtest_main sometimes also includes everything from gtest".
Many projects only link with
gtest_main
and it works somehow.So is
gtest_main
supposed to be a complete replacement ofgtest
+ themain
function, or not?Could you please document
gtest_main
and clearly define there what does it contain?Steps to reproduce the problem
n/a
What version of GoogleTest are you using?
googletest-1.14.0
What operating system and version are you using?
FreeBSD 14.0
What compiler and version are you using?
clang-16
What build system are you using?
cmake
Additional context
No response