Ask coding questions

← Back to all posts
How do I make a gui in C++?
h
JordanDixon1 (79)

I would like to know if this is even possible in repl.it. I have seen most tutorials saying I need to install programs on my computer to do this but I have no clue. Does anyone know if this is possible?

Answered by mwilki7 (654) [earned 5 cycles]
View Answer
Commentshotnewtop
mwilki7 (654)

I don't think you can do that with just a C++ repl (unless you're okay with making a GUI using the console).

You can do it in C++, but try a polyglott repl so you can download the necessary libraries (it also gives you access to a graphics window).

@SPQR
Has done a lot of stuff like this on repl if you want graphics through C++ code.

(I hope you don't mind me linking this SPQR if you read this)
https://repl.it/talk/share/SFML-on-replit-POC/11619

SPQR (480)

@mwilki7 I don't mind being linked, I'm always happy to help :)
Also, @JordanDixon1 to answer the original question, I myself have been working on trying to get any one of the popular C++ GUI libraries to work on here with little success thus far :P However, the <ncurses.h> library is great for making GUIs in the console, and works perfectly well on repl.it! You should even be able to use it in a regular C++ repl, if you add -lncurses to the run command.

It also should be noted that C++ is notoriously bad at making GUIs. ncurses is one of the few libraries that work very well.

The manual/docs for ncurses can be found here.