Share your repls and programming experiences

← Back to all posts
They've done it, everyone. You can now use ncurses on replit via the shell.
SPQR

The repl.it team made some changes to the compiler this morning. You can now compile via clang if you use the shell (accessible via the command palette.) Now you can make and run an ncurses program in just three easy steps! (steps shown are for c++)
1. #include <ncurses.h>
2. enter "clang -std=c++11 -lncurses main.cpp -o main" into the shell to compile
3. enter "/home/runner/main" into the shell to run
And enjoy!
note: this will run the program in the shell window instead of the normal run window, so keep that in mind. Also, I'm not sure if this works with repl.run yet. Also Also, you can just do step#3 to run your program again w/o applying any changes to the source.

Major props to the repl.it fellows for this one.

Voters
PaoloAmoroso
abc3354
SPQR
Comments
hotnewtop
tomekjaworski

There should be some configution functionality to add libraries.

SPQR

@tomekjaworski Are you just clicking "run"? because that won't work, you have to paste clang -std=c++11 -lncurses main.cpp -o main into the shell, and then /home/runner/main to run, for this particular program at least.

tomekjaworski

@SPQR Yes, I;m using the shell command line. However I was wandering is there a config entry in which I can specify compiler parameters (like list of libs to link)?

SPQR

@tomekjaworski not as of right now, unless you use polygott, which uses makefile syntax

beaver700nh

@tomekjaworski make a file called .replit in the root directory and put this in it: run="<the shell command you want to be run when you click the run button>"

beaver700nh

@beaver700nh I meant home directory not root

abc3354

Cool !