Hey everyone!
I am following a course in iTunes U teaching C programming for fun, and I am completely new to the language. There is a header file specific to the course for specific functions used in the coursework. Most of the command line work is being done in Linux, however I am doing my work in the Terminal in Mac OS X (Unix, obviously). Presently, I can't seem to #include the header file to have my code compile correctly! I have placed the header file in the folder I am presently working in, and in nano I have typed:
Code:
#include <stdio.h>
#include "cs50.h"
int
main (int argc, char * argv[])
{
string name;
printf("State your name: ");
name = GetString();
printf("hello, %s\n", name);
}
I then type
gcc -o hello3 hello3.c -cs50
at the command line. I end up with this error:
Undefined symbols:
"_GetString", referenced from:
_main in ccUiANy0.o
ld: symbol(s) not found
collect2: ld returned 1 exit status
GetString is one of the functions that is a part of this class specific library, and I am using a code example used by the instructor, so I should be using it correctly. Would anyone be able to point me in the right direction to what I could be doing wrong?
Thank you ahead of time for any help!