Compiling with curses on macOS
已回答
Howdy,
I have a simple C++ program that uses the Curses library. I'm on macOS using CLion.
It compiles fine if I do something like:
g++ -std=c++17 -lcurses -ltermcap file.cpp file.cpp file.cpp file.cpp -o nameofExec.x
in my terminal
But I cannot get my CMakeLists.txt right.
At the moment, it looks like this:
I believe something is wrong in my set() and link_directories().
I installed curses via 'brew install ncurses'
I am getting a "Error opening terminal: unkown." upon building.
Thanks in advance!!
请先登录再写评论。
Hello!
Running curses/ncurses in CLion is not yet supported - https://youtrack.jetbrains.com/issue/CPP-822. There is a workaround provided by the user in the issue's comments. And feel free to comment or upvote the issue, see https://intellij-support.jetbrains.com/hc/en-us/articles/207241135-How-to-follow-YouTrack-issues-and-receive-notifications if you are not familiar with YouTrack.
Also please see https://stackoverflow.com/questions/56703016/link-curses-in-mac-os-cmake and https://stackoverflow.com/a/43440347/11988753 provided in the comments to the first question.