URGENT!!! - How to run GitHub code onto vs in ubuntu ute

I was having trouble with running github code onto my mac terminal. After that I realized I need the ncurses library, so I installed it using macports and verified that it does contain ncursesw as well.


But It throws me an error "ncursesw/ncurses.h" file not found. I tried installing ubuntu 25.04 arm 64-bit architecture and vscode on utm, but I am still unable to run the code there.


So I tried to use another way: by installing a virtual machine. I did this by installing UTM along with Ubuntu 25.04 ARM 64-bit architecture. Afterwards I installed Visual Studios Code on my Linux environment as well.



However this was what happened after I tried to copy the link of a GitHub repo onto visual studios.


Afterwards it starts glitching(sudden increase and decrease in brightness as if it was blinking), and then it completely crashes like this



My assignment is due in 3 days I desperately need help!!!

MacBook Pro 14″, macOS 15.4

Posted on Apr 27, 2025 5:40 AM

Reply
5 replies

Apr 27, 2025 3:00 PM in response to g_wolfman

This works without any homebrew installed ncurses… and using clang++ or its g++ proxy… on Sequoia v15.4.1 and latest Xcode 16.3 and/or its accompanying Command Line Tools clang v17.0.


// clang++ -O2 -o curse_this curse_this.cpp -lncurses --std=c++23
// g++ -O2 -o curse_this curse_this.cpp -lncurses --std=gnu++23

#include <cstdlib>
#include <ncurses.h>

using namespace std;

int main(int argc, char **argv)
{
    // init screen and sets up screen
    initscr();

    // print to screen
    printw("Hello World");

    // refreshes the screen
    refresh();

    // pause the screen output
    getch();

    // deallocates memory and ends ncurses
    endwin();
    return 0;
}


Apr 27, 2025 2:29 PM in response to g_wolfman

Actually, a correction to my previous post - at least vis-a-vis macOS (and I still don't know if you are actually using - or supposed to be using - macOS or Linux for this).


ncursesw actually appears to be generated when ncurses is compiled with wide-character support. Whether you invoke ncurses in code with

#include <curses.h>

or

#include <ncurses/curses.h>

depends on whether ncurses is the default curses on your system or not (in which case it would have been compiled to not overwrite curses and thus put headers in ncurses/curses.h). But note the header name is curses.h, not ncurses.h - again, based on the macOS man pages...Linux might be different.

Depending on whether you have standard or wide character support will also affect if you are linking to -lncurses or -lncursesw.


So, it would appear to me that you ought to be including

#include <ncurses/curses.h>

and maybe linking with -lncursesw at some point, although who knows what development environment you are actually using...


Apr 27, 2025 10:48 AM in response to goatedmonkey_66

Is this assignment making assumptions about your development environment - specifically is it assuming that you are using a Linux environment (or does the course specify a Linux environment)?


ncursesw is the ncurses development environment - are you certain you have it installed? is it installed in the location the program you are trying to build expects? A fatal error involving

#include <ncursesw/ncurses.h>

seems like a namespace error to me. So again, is everything set up in accordance with what this assignment requires, or are you installing things based on random Internet posts on random forums?

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

URGENT!!! - How to run GitHub code onto vs in ubuntu ute

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.