lncurses on Clion with Ubuntu
lncurses on Clion with Ubuntu
我正在用C为学校做一个项目,我正在使用Clion作为idee。我已经使用命令在 Ubuntu 中安装了 ln curses
sudo apt-get install libncurses<ver>-dev
使用应,程序有效!但是我想用 idee 做一些调试。我的cmake文件是这个
cmake_minimum_required(VERSION 3.12)
project(progetto_pipe_2 C)
set(CMAKE_C_STANDARD 99)
add_executable(progetto_pipe_2 main.c movimento.c movimento.h grafica.c grafica.h area_gioco.c area_gioco.h)
如果我从 idee 启动应用程序,则会出现以下错误:
undefined reference to `initscr' ecc ecc
您需要在 cmake 配置文件中链接库。查看这篇文章: 如何在 Cmake 中链接 curses.h?
尝试:
cmake_minimum_required(VERSION 3.12)
project(progetto_pipe_2 C)
set(CMAKE_C_STANDARD 99)
# Define the target
add_executable(progetto_pipe_2 main.c movimento.c movimento.h grafica.c grafica.h area_gioco.c area_gioco.h)
# Look for the package you want to link
find_package( Curses REQUIRED )
# Include the directories of the package (to find curses.h for instance)
target_include_directories(progetto_pipe_2 PRIVATE ${CURSES_INCLUDE_DIRS} )
# Link the library
target_link_libraries(progetto_pipe_2 PRIVATE ${CURSES_LIBRARIES} )
相关文章:
- 在Ubuntu 16.04上安装Cilk时出现问题
- 如何在Ubuntu中使用cmake设置qt4
- Problems with std::cin.fail()
- 链接阶段在Ubuntu上失败,但在MacOS上失败
- 无法将 GLFW 库与 Ubuntu 18.04 上的头文件链接
- 无法在Ubuntu上将共享库与Eclipse链接
- 应用程序崩溃并显示"symbol _ZdlPvm, version Qt_5 not defined in file libQt5Core.so.5 with link time reference"
- 树莓上的 Libtorch 无法加载 pt 文件,但在 ubuntu 上工作
- 这对"With a stackless coroutine, only the top-level routine may be suspended."意味着什么
- Boost.TEST with CLion: "Test framework quit unexpectedly"
- 避免碎片化的ClientHellos with OpenSSL (DTLS)
- Issues with Win32 ReadProcessMemory API
- Qt with WinAPI MouseProc
- [[maybe_unused]] with structured_binding?
- Issue with WriteProcessMemory
- 无法安装 R 包 "nloptr"(Ubuntu 16.04 上的 R3.6.2) - C++编译器问题
- lncurses on Clion with Ubuntu
- 在 Ubuntu 上安装 OpenCV with GUI
- eclipse 4.2 cdt with ubuntu 12.04 configuration
- cgi with lighttpd on Ubuntu