We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Describe the bug
When compiling with Visual C++ 2015 or 2017 and CMake and the CMake flag BUILD_SHARED_LIBS is set to ON, you get the following linker errors:
BUILD_SHARED_LIBS
ON
googletest-printers-test.cc.obj : error LNK2019: unresolved external symbol "void __cdecl testing::internal::PrintTo(char16_t const *,class std::basic_ostream<char,struct std::char_traits<char> > *)" (?PrintTo@internal@testing@@YAXPEB_SPEAV?$basic_ostream@DU?$char_traits@D@std@@@std@@@Z) referenced in function "public: static void __cdecl testing::internal::UniversalPrinter<char16_t const *>::Print(char16_t const * const &,class std::basic_ostream<char,struct std::char_traits<char> > *)" (?Print@?$UniversalPrinter@PEB_S@internal@testing@@SAXAEBQEB_SPEAV?$basic_ostream@DU?$char_traits@D@std@@@std@@@Z) googletest-printers-test.cc.obj : error LNK2019: unresolved external symbol "void __cdecl testing::internal::PrintTo(char32_t const *,class std::basic_ostream<char,struct std::char_traits<char> > *)" (?PrintTo@internal@testing@@YAXPEB_UPEAV?$basic_ostream@DU?$char_traits@D@std@@@std@@@Z) referenced in function "public: static void __cdecl testing::internal::UniversalPrinter<char32_t const *>::Print(char32_t const * const &,class std::basic_ostream<char,struct std::char_traits<char> > *)" (?Print@?$UniversalPrinter@PEB_U@internal@testing@@SAXAEBQEB_UPEAV?$basic_ostream@DU?$char_traits@D@std@@@std@@@Z) googletest-param-test-test.cc.obj : error LNK2019: unresolved external symbol "public: __cdecl testing::internal::MarkAsIgnored::MarkAsIgnored(char const *)" (??0MarkAsIgnored@internal@testing@@QEAA@PEBD@Z) referenced in function "void __cdecl works_here::`dynamic initializer for 'gtest_allow_ignore_NotInstantiatedTest''(void)" (??__Egtest_allow_ignore_NotInstantiatedTest@works_here@@YAXXZ)
Steps to reproduce the bug
Run the developer command prompt for Visual C++ 2015 or 2017 and type the following commands:
cmake -S <source directory> -B <build directory> -G Ninja -D CMAKE_BUILD_TYPE=Debug -D gtest_build_tests=ON -D gtest_build_samples=ON -D BUILD_GMOCK=ON -D BUILD_SHARED_LIBS=ON cmake --build <build directory>
Does the bug persist in the most recent commit?
Yes
What operating system and version are you using?
Microsoft Windows [Version 10.0.19042.985]
What compiler and version are you using?
Microsoft (R) C/C++ Optimizing Compiler Version 19.00.24215.1 Microsoft (R) C/C++ Optimizing Compiler Version 19.16.27045
What build system are you using?
cmake version 3.20.2
Additional context
The text was updated successfully, but these errors were encountered:
Working on a fix.
Sorry, something went wrong.
Created pull request #3421 but can't seem to figure out how to link it to this issue.
Closing issue as fix was merged into master.
No branches or pull requests
Describe the bug
When compiling with Visual C++ 2015 or 2017 and CMake and the CMake flag
BUILD_SHARED_LIBS
is set toON
, you get the following linker errors:Steps to reproduce the bug
Run the developer command prompt for Visual C++ 2015 or 2017 and type the following commands:
Does the bug persist in the most recent commit?
Yes
What operating system and version are you using?
Microsoft Windows [Version 10.0.19042.985]
What compiler and version are you using?
Microsoft (R) C/C++ Optimizing Compiler Version 19.00.24215.1
Microsoft (R) C/C++ Optimizing Compiler Version 19.16.27045
What build system are you using?
cmake version 3.20.2
Additional context
The text was updated successfully, but these errors were encountered: