alandefreitas / clang-unformat

A simple tool to infer a .clang-format file from existing code
Boost Software License 1.0
58 stars 13 forks source link

Fails to build due to missing library linkage #2

Closed andrei-ng closed 2 years ago

andrei-ng commented 2 years ago

Hi @alandefreitas.

I forgot to raise this issue. The program fails to build because it cannot link against the correct threading library. I tried this on 2 different machines. I am going to submit a PR with the fix.

The error message at linker stage is:

[build] [100%] Linking CXX executable clang-unformat
[build] /usr/bin/ld: CMakeFiles/clang-unformat.dir/standalone/main.cpp.o: undefined reference to symbol 'pthread_condattr_setclock@@GLIBC_2.3.3'
[build] /usr/bin/ld: /usr/lib/libpthread.so.0: error adding symbols: DSO missing from command line
[build] collect2: error: ld returned 1 exit status
[build] make[2]: *** [CMakeFiles/clang-unformat.dir/build.make:101: clang-unformat] Error 1
[build] make[1]: *** [CMakeFiles/Makefile2:100: CMakeFiles/clang-unformat.dir/all] Error 2
[build] make: *** [Makefile:91: all] Error 2
[build] Build finished with exit code 2
alandefreitas commented 2 years ago

Oh... I forgot to find_package( Threads ) because GCC and Clang probably already add it by default now.