This question has already been answered:

I can not connect PDcurses to a C ++ project. After compilation we get the files panel.a , pdcurses.a and curses.h . How to attach them to the project, to finally get rid of the error

undefined reference to function

I tried several options for calling various functions in CMake.txt , but none of them came up. Solution of the problem is required using Cmake.txt - it would be the most correct way out.

Original CMake.txt content:

 cmake_minimum_required(VERSION 3.6) project(RogueLike) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") set(SOURCE_FILES main.cpp) add_executable(RogueLike ${SOURCE_FILES}) 

CMake version: 3.6, IDE: JetBrains CLion

Reported as a duplicate by the participants αλεχολυτ , aleksandr barakin , Pavel Parshin , cheops , tutankhamun 19 Oct '16 at 9:09 .

A similar question was asked earlier and an answer has already been received. If the answers provided are not exhaustive, please ask a new question .

  • @alexolut, as far as I can see, your question-answer does not reveal the topic of making changes to the cmake generator configuration, so this question cannot be considered a duplicate of what you specified. - aleksandr barakin
  • @alexanderbarakin doesn’t really say how to link via cmake , but the problem is precisely in the absence of a linker specifying the required library. In any case, I can no longer re-vote on a duplicate, only if I canceled my vote for closing at all. - αλεχολυτ

0