0

I have attempted this guide multiple times, but to my understanding it shows how to connect CLion to the database, I simply want to include the occi.h external library.

Downloaded instantclient_21_6 Basic Package (ZIP)

and this is my CMakeLists.txt

cmake_minimum_required(VERSION 3.22)
project(oracle)
set(CMAKE_CXX_STANDARD 14)

link_libraries(/home/ilghar/instantclient_21_6)
target_link_libraries(oracle)

add_executable(oracle main.cpp)

This is the error i get when reloading CMakeLists.txt

CMake Error at CMakeLists.txt:5 (target_link_libraries):
  Cannot specify link libraries for target "oracle" which is not built by
  this project.
ilghar
  • 15
  • 6
  • The first argument accepted by `target_link_libraries` denotes the name of the **target**. This target should be previously created by `add_executable` or `add_library` call. The second and further arguments are **libraries** which you want to link to your target. For being able to include headers, you need additionally to add **include directories**; this could be performed with `target_include_directories` command. – Tsyvarev Apr 23 '22 at 08:52

0 Answers0