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 (535)

The 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 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 fellows for this one.

tomekjaworski (0)

There should be some configution functionality to add libraries.

clang++-7 -pthread -std=c++11 -o main main.cpp
/tmp/main-6026d9.o: In function `main':
main.cpp:(.text+0x10): undefined reference to `initscr'
main.cpp:(.text+0x19): undefined reference to `cbreak'
main.cpp:(.text+0x21): undefined reference to `noecho'
main.cpp:(.text+0x40): undefined reference to `stdscr'
main.cpp:(.text+0x45): undefined reference to `wgetch'
main.cpp:(.text+0x74): undefined reference to `refresh'
clang: error: linker command failed with exit code 1 (use -v to see invocation)
compiler exit status 1
SPQR (535)

@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 (0)

@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 (535)

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