error: undefined reference to 'tensorflow::TensorShapeBase<tensorflow::TensorShape>::TensorShapeBase(absl::Span<long const>)'
Hi @p3achyjr ,

Could you please confirm the build command you have used along with the options selected during the `./configure` step.

Also please check the tested configurations for build from source.




Version | Python version | Compiler | Build tools | cuDNN | CUDA
-- | -- | -- | -- | -- | --
tensorflow-2.12.0 | 3.8-3.11 | GCC 9.3.1 | Bazel 5.3.0 | 8.6 | 11.8
tensorflow-2.11.0 | 3.7-3.10 | GCC 9.3.1 | Bazel 5.3.0 | 8.1 | 11.2

Could you please upgrade CUDA to 11.2,cuDNN to 8.1 and GCC to 9.3.1 and then try the build.

Also please ensure you have C++17 environment. Thanks!
 This issue is stale because it has been open for 7 days with no activity. It will be closed if no further activity occurs. Thank you. This issue was closed because it has been inactive for 7 days since being marked as stale. Please reopen if you'd like to work on this further. Are you satisfied with the resolution of your issue?
<a href="https://docs.google.com/forms/d/e/1FAIpQLSfaP12TRhd9xSxjXZjcZFNXPGk4kc1-qMdv3gc6bEP90vY1ew/viewform?entry.85265664=Yes&entry.2137816233=https://github.com/tensorflow/tensorflow/issues/60754">Yes</a>
<a href="https://docs.google.com/forms/d/e/1FAIpQLSfaP12TRhd9xSxjXZjcZFNXPGk4kc1-qMdv3gc6bEP90vY1ew/viewform?entry.85265664=No&entry.2137816233=https://github.com/tensorflow/tensorflow/issues/60754">No</a>

<details><summary>Click to expand!</summary> 
 
 ### Issue Type

Bug

### Have you reproduced the bug with TF nightly?

No

### Source

source

### Tensorflow Version

2.11

### Custom Code

Yes

### OS Platform and Distribution

Debian GNU/Linux 10

### Mobile device

_No response_

### Python version

3.7

### Bazel version

5.3.0

### GCC/Compiler version

gcc 9

### CUDA/cuDNN version

11

### GPU model and memory

Tesla T4

### Current Behaviour?

When I run a build with `--config=opt`, I get the following error:

```
error: undefined reference to 'tensorflow::TensorShapeBase<tensorflow::TensorShape>::TensorShapeBase(absl::Span<long const>)'
```

However, compiling normally is fine.

Checking llvm-nm, I see these symbols in optimized build:

```
U _ZN10tensorflow15TensorShapeBaseINS_11TensorShapeEEC1EN4absl4SpanIKlEE
0000000000000000 W _ZN10tensorflow6Tensor16unaligned_shapedIfLm1EEENS_6TTypesIT_XT0_ElE15UnalignedTensorEN4absl4SpanIKlEE
0000000000000000 W _ZNK10tensorflow6Tensor34FillDimsAndValidateCompatibleShapeILm1EEEvN4absl4SpanIKlEEPSt5arrayIlXT_EE
```

but these in normal:

```
0000000000000000 W _ZN10tensorflow6Tensor16unaligned_shapedIfLm1EEENS_6TTypesIT_XT0_ElE15UnalignedTensorEN4absl4SpanIKlEE
0000000000000000 W _ZN4absl4SpanIKlEC1EPS1_m
0000000000000000 W _ZN4absl4SpanIKlEC1IS1_S1_EESt16initializer_listIlE
0000000000000000 W _ZN4absl4SpanIKlEC2EPS1_m
0000000000000000 W _ZN4absl4SpanIKlEC2IS1_S1_EESt16initializer_listIlE
0000000000000000 n _ZN4absl4SpanIKlEC5EPS1_m
0000000000000000 n _ZN4absl4SpanIKlEC5IS1_S1_EESt16initializer_listIlE
0000000000000000 W _ZNK10tensorflow6Tensor34FillDimsAndValidateCompatibleShapeILm1EEEvN4absl4SpanIKlEEPSt5arrayIlXT_EE
0000000000000000 W _ZNK4absl4SpanIKlE4dataEv
0000000000000000 W _ZNK4absl4SpanIKlE4sizeEv
0000000000000000 W _ZNK4absl4SpanIKlEixEm
0000000000000000 W _ZZNK4absl4SpanIKlEixEmENKUlvE_clEv
```

I am building tensorflow from source and copying `libtensorflow_cc.so`, `libtensorflow_framework.so`, and include files into my project. However, the linking step fails as described above.

### Standalone code to reproduce the issue

```shell
Build tensorflow from source, copy .so and include files into your own project, and try to use tensorflow headers in project.
```


### Relevant log output

_No response_</details>