Hello im taking the harvard intro to cs course and am having the following error
~/workspace/pset1/mario/less/ $ clang mario.c
/tmp/mario-69d749.o: In function `main':
mario.c:(.text+0x1c): undefined reference to `get_int'
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Kindof lost as ive had so many issues with cloud9...anyhow here is my code
int n = get_int("Height: ");
} while (n > 0 || n > 23);
for (int i = 0; i < n; i++)
for (int j = 0; j < n + 1; j++)
if (i + j >= n - 1)
Im honestly scared to try anymore solutions i have looked up as another non-working solution wil involve me restarting the workspace at best...or restarting my pc at worst....ive tried to use GetInt but that didnt work either. any explanation why my code isnt working would be appreciated.
In this situation, the get_int function is an external function defined in an external library. The program cannot be built unless you tell clang the name of the external library. The "-lcs50" command line option is telling clang to use the external library "cs50". I'm assuming the external library "cs50" is provided by the professor for the class to use.
Please follow-up to let us know how you made out. For good karma, mark a reply as the answer if it helped!