Home > Enterprise >  Ncurses.h ( (.text 0xd): undefined reference to `initscr') visual code Ubuntu
Ncurses.h ( (.text 0xd): undefined reference to `initscr') visual code Ubuntu

Time:10-26

I need to know why VS code is not compiling ncurses.h. but it is possible to compile in the terminal ubuntu. this message is appearing on the VS code. (.text 0xd): undefined reference to `initscr'

CodePudding user response:

the code runner extension configuration add -lncurses before -o

"code-runner.executorMap": { "c": "cd $dir && gcc $fileName -lncurses -o $fileNameWithoutExt && $dir$fileNameWithoutExt " }

CodePudding user response:

I solved this problem adding "-lncurses" in the "args" (tasks.json)

"args": [
    "-g",
    "${file}",
    "-o",
    "${fileDirname}/${fileBasenameNoExtension}",
    "-lncurses" <--------- add the library ("-lncurses" ) here 
],
  • Related