Guest User

Untitled

a guest
Oct 18th, 2017
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.74 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <cs50.h>
  3.  
  4. int main(void)
  5. {
  6. printf("State our name: ");
  7. string s = GetString();
  8. printf("hello, %sn", s);
  9. }
  10.  
  11. /tmp/ccHZXs2m.o: In function `main'
  12. hell.c:(.text+0x16): undefined reference to `GetString'
  13. collect2: error: ld returned 1 exit status
  14. make: *** [hell] Error 1
  15.  
  16. int main(void) {
  17. string name;
  18. printf("Введите ваше имя");
  19. scanf("%s", name);
  20. printf("Привет, %sn!", name);
  21. return 0;
  22. }
  23.  
  24. cc -c help.c -o help.o
  25. cc -c cs50.c -o cs50.c
  26. cc -o help help.o cs50.o
  27.  
  28. string GetString(void)
  29. {
  30. return "test";
  31. }
  32.  
  33. CC=clang
  34. CFLAGS=-ggdb3 -O0 -std=c99 -Wall -Werror
  35. LDLIBS=-lcs50 -lm
  36.  
  37. make hell
  38.  
  39. gcc -o ./hello[.exe] hello.c cs50/lib/src/cs50.c
  40.  
  41. get_string()
Add Comment
Please, Sign In to add comment