Skip to content

Linking error with clang #11

@stwunsch

Description

@stwunsch

Hi!

I get undefined references if i build with the following cmake command:

cmake /path/to/vdt -DDIAG=ON -DDEBUG=ON -DCMAKE_CXX_COMPILER="clang++" -DCMAKE_C_COMPILER="clang

The error:

/usr/bin/ld: CMakeFiles/test_randomPool.dir/test_randomPool.cpp.o: in function `refMath::exp(double)':
/home/stefan/workspace/vdt/include/diagnostic/vdtdiag_helper.h:54: undefined reference to `__exp_finite'
/usr/bin/ld: CMakeFiles/test_randomPool.dir/test_randomPool.cpp.o: in function `refMath::expf(float)':
/home/stefan/workspace/vdt/include/diagnostic/vdtdiag_helper.h:55: undefined reference to `__expf_finite'
/usr/bin/ld: CMakeFiles/test_randomPool.dir/test_randomPool.cpp.o: in function `refMath::log(double)':
/home/stefan/workspace/vdt/include/diagnostic/vdtdiag_helper.h:56: undefined reference to `__log_finite'
/usr/bin/ld: CMakeFiles/test_randomPool.dir/test_randomPool.cpp.o: in function `refMath::logf(float)':
/home/stefan/workspace/vdt/include/diagnostic/vdtdiag_helper.h:57: undefined reference to `__logf_finite'
/usr/bin/ld: CMakeFiles/test_randomPool.dir/test_randomPool.cpp.o: in function `std::log(long double)':
/usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/9.2.1/../../../../include/c++/9.2.1/cmath:343: undefined reference to `__logl_finite'
/usr/bin/ld: /usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/9.2.1/../../../../include/c++/9.2.1/cmath:343: undefined reference to `__logl_finite'
clang-9: error: linker command failed with exit code 1 (use -v to see invocation)

My setup:

clang 9.0.1
cmake 3.16.4

Best
Stefan

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions