abseil / abseil/abseil-cpp

[Bug]: undefined reference to `absl::lts_20211102::

Đang mở
#1,428 3 bình luận 1 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
C++
Star
18.1k
Fork
3.2k
Merge trung bình
20 giờ 36 phút
Pull request đã merge (30 ngày)
1

Mô tả

### Describe the issue

Hi, I have built abseil from source, but when I compile other projects using absl, I got a lot `undefined reference to `absl::lts_20211102:: .....` errors.

```
git clone https://github.com/abseil/abseil-cpp.git --recursive
cd abseil-cpp
git checkout 20211102.0
git submodule update --init --recursive
mkdir build && cd build
cmake -DCMAKE_CXX_STANDARD=17 -DABSL_CXX_STANDARD=17 -DABSL_USE_GOOGLETEST_HEAD=ON -DCMAKE_MODULE_LINKER_FLAGS=\"-Wl,--no-undefined -Wl,--no-undefined\" -DCMAKE_INSTALL_PREFIX=$PWD/install -DCMAKE_POSITION_INDEPENDENT_CODE=TRUE -DBUILD_SHARED_LIBS=ON -DNDEBUG=1 ..
make -j
make -j install
```
I notice that after I built it, for example, there is a
```
absl::variant_internal::ThrowBadVariantAccess()
```
in the file, but is there any way we can set the namespace to be as defined in `/mydir/abseil-cpp/absl/base/options.h`, Line 208~209:
```
#define ABSL_OPTION_USE_INLINE_NAMESPACE 1
#define ABSL_OPTION_INLINE_NAMESPACE_NAME lts_20211102
```

As when compiling my other project, it always raises the error like this:
```
../libtritonserver.so: undefined reference to `absl::lts_20211102::variant_internal::ThrowBadVariantAccess()'
```

### Steps to reproduce the problem

As listed above

### What version of Abseil are you using?

20211102.0, but I have also tried multiple other versions

### What operating system and version are you using?

RHEL 8

### What compiler and version are you using?

gcc 8.5

### What build system are you using?

cmake 3.26

### Additional context

_No response_

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.