Skip to main content
2 of 2
added 24 characters in body; edited tags
kzidane
  • 17.7k
  • 3
  • 28
  • 100

Undefined reference to `GetString'

I'm having the following error

myName.c:(.text+0x18): undefined reference to `GetString'

It seems that something is wrong with the cs50 library. What is this file suppose to contain? In my case it doesn't contain any usable code. Example of the cs50.h content

char GetChar(void);

I'm using VM Player with the appliance50-19. Nothing was modified. Clean install.

My code:

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

int main(void)
{
    printf("Name:\n");
    string myName = GetString();
    printf("My name, %s\n", myName);
}