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

Clang link error #1

Closed
buck-yeh opened this issue Feb 12, 2021 · 1 comment
Closed

Clang link error #1

buck-yeh opened this issue Feb 12, 2021 · 1 comment
Labels
help wanted Extra attention is needed question Further information is requested

Comments

@buck-yeh
Copy link
Owner

When I configure the repo to build with Clang like this:

rm CMakeCaches.txt
CXX=clang CC=clang cmake .
make clean
make -j

I got:

/usr/bin/ld: ../src/libbux.a(StrUtil.cpp.o): undefined reference to symbol '_ZSt20__throw_length_errorPKc@@GLIBCXX_3.4'
/usr/bin/ld: /usr/lib/libstdc++.so.6: error adding symbols: DSO missing from command line
clang-11: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [_deps/fetchedbux-build/test/CMakeFiles/test_expand_env.dir/build.make:104: _deps/fetchedbux-build/test/test_expand_env] Error 1
make[1]: *** [CMakeFiles/Makefile2:208: _deps/fetchedbux-build/test/CMakeFiles/test_expand_env.dir/all] Error 2
make: *** [Makefile:103: all] Error 2

Please advice

@buck-yeh buck-yeh added help wanted Extra attention is needed question Further information is requested labels Feb 12, 2021
@buck-yeh
Copy link
Owner Author

I found the solution myself by adding

target_link_libraries(... stdc++)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed question Further information is requested
Projects
None yet
Development

No branches or pull requests

1 participant