# Header File Not found while building with CPP

**URL:** <https://discuss.ai.google.dev/t/header-file-not-found-while-building-with-cpp/33161>\
**Category:** TensorFlow\
**Tags:** cpp, api\
**Created:** [July 11, 2024, 12:23pm UTC](https://discuss.ai.google.dev/t/header-file-not-found-while-building-with-cpp/33161 "2024-07-11T12:23:10Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Narayan](https://d1dlmcr85iqnpo.cloudfront.net/user_avatar/discuss.ai.google.dev/narayan/32/16159_2.png) [@Narayan](https://discuss.ai.google.dev/u/Narayan)\
**Post date:** [July 11, 2024, 12:23pm UTC](https://discuss.ai.google.dev/t/header-file-not-found-while-building-with-cpp/33161/1 "2024-07-11T12:23:10Z")

</div>

Hi , I’m trying to build a small project using the TF CPP API.

```cmake
cmake_minimum_required(VERSION 3.10)
project(TensorFlowCPPExample)

# Set TensorFlow directories
set(TENSORFLOW_INCLUDE_DIR $ENV{TENSORFLOW_INCLUDE_DIR})
set(TENSORFLOW_THIRD_PARTY_DIR $ENV{TENSORFLOW_THIRD_PARTY_DIR})
set(TENSORFLOW_LIB_DIR $ENV{TENSORFLOW_LIB_DIR})

# Include TensorFlow headers
include_directories(${TENSORFLOW_INCLUDE_DIR})
include_directories(${TENSORFLOW_THIRD_PARTY_DIR})
include_directories(/home/vorrtt3x/cloned/tensorflow/bazel-bin/tensorflow/core/framework)

# Add your executable
add_executable(example main.cpp)

# Link TensorFlow library
target_link_libraries(example /home/vorrtt3x/cloned/tensorflow/bazel-bin/tensorflow/libtensorflow_cc.so.2 )
target_link_libraries(example /home/vorrtt3x/cloned/tensorflow/bazel-bin/tensorflow/libtensorflow_framework.so.2)

```

I’m getting the following Error:

```auto
/home/vorrtt3x/cloned/tensorflow/tensorflow/core/public/session.h:24:10: fatal error: tensorflow/core/framework/device_attributes.pb.h: No such file or directory
   24 | #include "tensorflow/core/framework/device_attributes.pb.h"
      | ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.

```
