1

I'm new in C. My code uses termcap library. And I'm trying to debug my code using Clion through Cmake Application. But it can't be compiled because functions that i use from a library are undefined. What should i add to CMakeLists.txt to debug my project? My CMakeLists.txt now:

cmake_minimum_required(VERSION 3.21)

project(minishell C)
 
set(CMAKE_C_STANDARD 99)
 
add_executable(minishell main.c)

When i compile using clang i just do this:

clang main.c -ltermcap

and it works. Can't understand what to do. Please help.

Smoooky
  • 11
  • 2
  • So the question is how to **link** with a library in CMake? It so, then linking is performed with `target_link_libraries` command. This is written in almost any tutorial for CMake... – Tsyvarev Dec 25 '21 at 18:50
  • The actual error-messages aren't shown. Also, it's unlikely that the proper library is `-ltermcap` since almost all systems use a termcap interface over terminfo, e.g., `-lncurses`. – Thomas Dickey Dec 26 '21 at 00:48
  • Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking. – Community Jan 05 '22 at 16:40

0 Answers0