Ask coding questions

← Back to all posts
Why doesn't nCurses work on my repl?
Terra361

I am using the nCurses library on my project. I am trying to generate pixels in the console, but all I get when I run the code is Undefined reference to many of my lines. What is happening?
By the way, I am still learning how to do a lot of this.
Also my code is not even remotely cleaned up, so it might just be that I need to finish writing the script.

Answered by DynamicSquid [earned 5 cycles]
View Answer
Voters
ViniciusRocha5
Terra361
Comments
hotnewtop
DynamicSquid

Okay, so to compile and run your program, type this in the console:

Or if you want, create a new file called .replit, and type this in:

Then just hit the run button and it should work!

This is because you have to link the curses library since it's an external one and g++ can't do it for you automatically.

DynamicSquid

You have to link the curses library manually. One sec, lemme try to get it working

Coder100

Does repl.it maybe not support ncurses.h?

Terra361

@Coder100 I thought so. It accepts ncurses.h as a file.