cloudrain21 / googletest

Automatically exported from code.google.com/p/googletest
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

Make gtest usable with -fvisibility=hidden #496

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
The GTEST_API_ macro is defined as empty unless one is building with the MSVC 
compilers. However, clang and gcc (version >= 4) support the 
-fvisibility=hidden command line option which leads to behaviour similar to 
MSVC as far as symbol visibility in DSOs is concerned. The current definition 
of GTEST_API_ is wrong in this case.

What steps will reproduce the problem?
1. Compile gtest shared libraries with gcc with -fvisibility=hidden

What is the expected output? What do you see instead?
The expected behaviour is to be able to link against libgtest.so and 
libgtest_main.so but the observed behavior is a linker error because the 
symbols in the gtest API are not exported from the gtest libraries.

What version of Google Test are you using? On what operating system?
1.7 on centos 6 with gcc 4.9

Original issue reported on code.google.com by dmeise...@gmail.com on 5 Aug 2015 at 1:26

GoogleCodeExporter commented 9 years ago
Just realized that this is a duplicate of issue #451.

Original comment by dmeise...@gmail.com on 5 Aug 2015 at 1:56

GoogleCodeExporter commented 9 years ago

Original comment by sbe...@google.com on 5 Aug 2015 at 6:35