Skip to content
New issue

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

Does not build the tests with WITH_STL=CXX17 #3102

Closed
t-b opened this issue Oct 16, 2024 · 5 comments · Fixed by #3106
Closed

Does not build the tests with WITH_STL=CXX17 #3102

t-b opened this issue Oct 16, 2024 · 5 comments · Fixed by #3106
Labels
bug Something isn't working triage/accepted Indicates an issue or PR is ready to be actively worked on.

Comments

@t-b
Copy link
Contributor

t-b commented Oct 16, 2024

Linux: debian bookworm, GCC 12.2.0

With

git clean -fdx build

cmake -S . -B build                    \
  -DBUILD_TESTING=ON                   \
  -DWITH_EXAMPLES=OFF                  \
  -DCMAKE_BUILD_TYPE=RelWithDebInfo    \
  -DCMAKE_POSITION_INDEPENDENT_CODE=ON \
  -DBUILD_SHARED_LIBS=ON               \
  -DWITH_OTLP_GRPC=ON                  \
  -DWITH_OTLP_HTTP=ON                  \
  -DWITH_ABSEIL=ON                     \
  -DWITH_BENCHMARK=OFF                 \
  -DCMAKE_CXX_STANDARD=17              \
  -DWITH_STL=CXX17

cmake --build build --target install

I get

/usr/bin/ld: ../../test_common/src/http/client/nosend/libopentelemetry_http_client_nosend.so: undefined reference to `typeinfo for testing::internal::UntypedFunctionMockerBase'
/usr/bin/ld: ../../test_common/src/http/client/nosend/libopentelemetry_http_client_nosend.so: undefined reference to `testing::internal::Log(testing::internal::LogSeverity, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, int)'
/usr/bin/ld: ../../test_common/src/http/client/nosend/libopentelemetry_http_client_nosend.so: undefined reference to `testing::internal::UntypedFunctionMockerBase::~UntypedFunctionMockerBase()'
/usr/bin/ld: ../../test_common/src/http/client/nosend/libopentelemetry_http_client_nosend.so: undefined reference to `testing::internal::UntypedFunctionMockerBase::SetOwnerAndName(void const*, char const*)'
/usr/bin/ld: ../../test_common/src/http/client/nosend/libopentelemetry_http_client_nosend.so: undefined reference to `testing::internal::ReportUninterestingCall(testing::internal::CallReaction, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
/usr/bin/ld: ../../test_common/src/http/client/nosend/libopentelemetry_http_client_nosend.so: undefined reference to `testing::internal::GetFailureReporter()'
/usr/bin/ld: ../../test_common/src/http/client/nosend/libopentelemetry_http_client_nosend.so: undefined reference to `testing::internal::ExpectationBase::AllPrerequisitesAreSatisfied() const'
/usr/bin/ld: ../../test_common/src/http/client/nosend/libopentelemetry_http_client_nosend.so: undefined reference to `testing::internal::ExpectationBase::FindUnsatisfiedPrerequisites(testing::ExpectationSet*) const'
/usr/bin/ld: ../../test_common/src/http/client/nosend/libopentelemetry_http_client_nosend.so: undefined reference to `testing::internal::UntypedFunctionMockerBase::Name() const'
/usr/bin/ld: ../../test_common/src/http/client/nosend/libopentelemetry_http_client_nosend.so: undefined reference to `testing::Mock::UnregisterLocked(testing::internal::UntypedFunctionMockerBase*)'
/usr/bin/ld: ../../test_common/src/http/client/nosend/libopentelemetry_http_client_nosend.so: undefined reference to `testing::internal::ExpectationBase::CheckActionCountIfNotDone() const'
/usr/bin/ld: ../../test_common/src/http/client/nosend/libopentelemetry_http_client_nosend.so: undefined reference to `testing::internal::IllegalDoDefault(char const*, int)'
/usr/bin/ld: ../../test_common/src/http/client/nosend/libopentelemetry_http_client_nosend.so: undefined reference to `testing::Mock::GetReactionOnUninterestingCalls(void const*)'
/usr/bin/ld: ../../test_common/src/http/client/nosend/libopentelemetry_http_client_nosend.so: undefined reference to `testing::internal::ExpectationBase::RetireAllPreRequisites()'
/usr/bin/ld: ../../test_common/src/http/client/nosend/libopentelemetry_http_client_nosend.so: undefined reference to `testing::internal::UntypedFunctionMockerBase::MockObject() const'
/usr/bin/ld: ../../test_common/src/http/client/nosend/libopentelemetry_http_client_nosend.so: undefined reference to `testing::internal::ExpectationBase::DescribeCallCountTo(std::ostream*) const'
/usr/bin/ld: ../../test_common/src/http/client/nosend/libopentelemetry_http_client_nosend.so: undefined reference to `testing::internal::UntypedFunctionMockerBase::VerifyAndClearExpectationsLocked()'
/usr/bin/ld: ../../test_common/src/http/client/nosend/libopentelemetry_http_client_nosend.so: undefined reference to `testing::internal::LogIsVisible(testing::internal::LogSeverity)'
/usr/bin/ld: ../../test_common/src/http/client/nosend/libopentelemetry_http_client_nosend.so: undefined reference to `testing::internal::g_gmock_mutex'
/usr/bin/ld: ../../test_common/src/http/client/nosend/libopentelemetry_http_client_nosend.so: undefined reference to `testing::internal::UntypedFunctionMockerBase::UntypedFunctionMockerBase()'
/usr/bin/ld: ../../test_common/src/http/client/nosend/libopentelemetry_http_client_nosend.so: undefined reference to `testing::Expectation::~Expectation()'
collect2: error: ld returned 1 exit status
gmake[2]: *** [exporters/otlp/CMakeFiles/otlp_http_exporter_test.dir/build.make:125: exporters/otlp/otlp_http_exporter_test] Fehler 1
gmake[1]: *** [CMakeFiles/Makefile2:5466: exporters/otlp/CMakeFiles/otlp_http_exporter_test.dir/all] Fehler 2
gmake: *** [Makefile:146: all] Fehler 2
@t-b t-b added the bug Something isn't working label Oct 16, 2024
@github-actions github-actions bot added the needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. label Oct 16, 2024
@owent
Copy link
Member

owent commented Oct 17, 2024

Thanks, Could you please help to test https://github.com/owent/opentelemetry-cpp/tree/fix_link_order and check if it's fixed?

@marcalff marcalff added triage/accepted Indicates an issue or PR is ready to be actively worked on. and removed needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Oct 17, 2024
@t-b
Copy link
Contributor Author

t-b commented Oct 17, 2024

@owent Thanks for the reply. Nope, that does not fix it.

@owent
Copy link
Member

owent commented Oct 18, 2024

@owent Thanks for the reply. Nope, that does not fix it.

Just wondering, how do you build dependencies? I will try to reproduce this problem.

@owent
Copy link
Member

owent commented Oct 18, 2024

@owent Thanks for the reply. Nope, that does not fix it.

I reproduced this problem, https://github.com/owent/opentelemetry-cpp/tree/fix_link_order should be able to fix it now, could you please test it again?

@t-b
Copy link
Contributor Author

t-b commented Oct 18, 2024

@owent Yes that fixes it. Thanks a lot.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working triage/accepted Indicates an issue or PR is ready to be actively worked on.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants