serizba / cppflow

Run TensorFlow models in C++ without installation and without Bazel
https://serizba.github.io/cppflow/
MIT License
774 stars 177 forks source link

cannot find -linclude/libtensorflow/lib: No such file or directory #222

Closed alex290 closed 1 year ago

alex290 commented 1 year ago

Help I can't build in Windows 10

  1. Downloaded the archive https://github.com/serizba/cppflow/archive/refs/tags/v2.0.0.zip

  2. Added an archive to the include folder https://www.tensorflow.org/install/lang_c in the libtensorflow folder

  3. Tried to build via Cmake

I got an error during assembly cannot find -linclude/libtensorflow/lib: No such file or directory

alex290 commented 1 year ago

And so who will use Windows + Cmake + Vscode here is the working version

Cmake

cmake_minimum_required(VERSION 3.10)
project(example)

include_directories(${CMAKE_SOURCE_DIR}/include)
link_directories(${CMAKE_SOURCE_DIR}/lib)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)

file(GLOB sources "./src/*.cpp")
add_executable(example ${sources})
target_link_libraries(example tensorflow)
configure_file(${CMAKE_SOURCE_DIR}/lib/tensorflow.dll ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/tensorflow.dll COPYONLY)

I placed header (CppFlow, TensorFlow) in the include folder.
And I threw lib (TensorFlow) into the lib folder