Skip to main content
added 30 characters in body
Source Link
MARS
  • 5.2k
  • 3
  • 14
  • 23

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

int main(void) { string name = get_string("what is your name?\n"); printf("hello,%s\n",name); }"

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

int main(void)
{
    string name = get_string("what is your name?\n");
    printf("hello,%s\n",name);
}
  • When I compile the above code using command "clang myfilename.c" the following error shows up "/tmp/helloworld-19a552.o: In function main': helloworld.c:(.text+0x19): undefined reference to get_string' clang: error: linker command failed with exit code 1 (use -v to see invocation)"

What does above error mean and why does it show up?

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

int main(void) { string name = get_string("what is your name?\n"); printf("hello,%s\n",name); }"

  • When I compile the above code using command "clang myfilename.c" the following error shows up "/tmp/helloworld-19a552.o: In function main': helloworld.c:(.text+0x19): undefined reference to get_string' clang: error: linker command failed with exit code 1 (use -v to see invocation)"

What does above error mean and why does it show up?

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

int main(void)
{
    string name = get_string("what is your name?\n");
    printf("hello,%s\n",name);
}
  • When I compile the above code using command "clang myfilename.c" the following error shows up "/tmp/helloworld-19a552.o: In function main': helloworld.c:(.text+0x19): undefined reference to get_string' clang: error: linker command failed with exit code 1 (use -v to see invocation)"

What does above error mean and why does it show up?

Source Link

Got into an unexpected error while compiling the code

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

int main(void) { string name = get_string("what is your name?\n"); printf("hello,%s\n",name); }"

  • When I compile the above code using command "clang myfilename.c" the following error shows up "/tmp/helloworld-19a552.o: In function main': helloworld.c:(.text+0x19): undefined reference to get_string' clang: error: linker command failed with exit code 1 (use -v to see invocation)"

What does above error mean and why does it show up?