0

I was trying to run the below program on CS50 IDE, however it shows an error, is it something wrong with the CS50 IDE ?

#include <cs50.h>
#include <stdio.h>

int main(void)
{
    int n;
    do
    {
        n = get_int("Size: ");
    }
    while (n < 1);
    for (int i = 0; i < n; i++)
    {
        for (int j = 0; j < n; j++)
        {
            printf("#");
        }
        printf("\n");
    }
}

The error was:

~/pset1/Mario/ $ clang -o mario mario.c /tmp/mario-cd1aec.o: In function main': mario.c:(.text+0x26): undefined reference toget_int' clang-7: error: linker command failed with exit code 1 (use -v to see invocation)

1
  • 1
    Try doing make mario instead of clang
    – Ojou Nii
    May 18 '20 at 13:54
1

The code is fine. It must be a bug with clang or aws. Try compiling it again.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .