Undefined reference when using ncurses on linux

前端 未结 4 581
温柔的废话
温柔的废话 2020-12-30 08:57

I\'m trying to start developing a program using ncurses on Linux. I can\'t even get the Hello World example to compile. Here\'s the code:

#include 

        
4条回答
  •  自闭症患者
    2020-12-30 09:38

    Have you used the -lcurses option when linking?

    Including the header files let the code compile (because the compiler knows what the function call looks like from the .h file), but the linker needs the library file to find the actual code to link into your program.

提交回复
热议问题