'CS50 IDE clang: error: linker command failed with exit code 1

I am learning C programming from CS50. I was trying to to build parity program. Here is my code,

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

int main (void)
{
    int n=get_int("n: ");
    if(n%2==0)
    printf("even\n");
    else
    printf("odd\n");
}

when I try to compile I get the following error,

clang: error: linker command failed with exit code 1 

Can anyone tell what's going on here?

I was trying to compile this on official CS50 IDE and I got that error .

This is my first question on stackoverflow, so pardon me if I am doing any bad formatting or styling.

Any help will be highly appreciated.



Solution 1:[1]

I figured it myself. There was a folder with same name as my c source file. That's why clang got confused.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Chumki Haldar