Guest User

Untitled

a guest
Dec 15th, 2018
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.60 KB | None | 0 0
  1. $> make re
  2. gcc -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -lglib-2.0 re.c -o re
  3. /tmp/ccxas1nI.o: In function `print_uppercase_words':
  4. re.c:(.text+0x21): undefined reference to `g_regex_new'
  5. re.c:(.text+0x41): undefined reference to `g_regex_match'
  6. re.c:(.text+0x54): undefined reference to `g_match_info_fetch'
  7. re.c:(.text+0x6e): undefined reference to `g_print'
  8. re.c:(.text+0x7a): undefined reference to `g_free'
  9. re.c:(.text+0x8b): undefined reference to `g_match_info_next'
  10. re.c:(.text+0x97): undefined reference to `g_match_info_matches'
  11. re.c:(.text+0xa7): undefined reference to `g_match_info_free'
  12. re.c:(.text+0xb3): undefined reference to `g_regex_unref'
  13. collect2: ld returned 1 exit status
  14. make: *** [re] Error 1
  15.  
  16. # Need to installed libglib2.0-dev some system specific install that will
  17. # provide a value for pkg-config
  18. INCLUDES=$(shell pkg-config --libs --cflags glib-2.0)
  19. CC=gcc $(INCLUDES)
  20. PROJECT=re
  21.  
  22. # Targets
  23. full: clean compile
  24.  
  25. clean:
  26. rm $(PROJECT)
  27.  
  28. compile:
  29. $(CC) $(PROJECT).c -o $(PROJECT)
  30.  
  31. $> glib-config
  32. No command 'glib-config' found, did you mean:
  33. Command 'gdlib-config' from package 'libgd2-xpm-dev' (main)
  34. Command 'gdlib-config' from package 'libgd2-noxpm-dev' (main)
  35. glib-config: command not found
  36.  
  37. re.c:(.text+0xd6): undefined reference to `print_uppercase_words'
  38.  
  39. void print_upppercase_words(const gchar *string)
  40.  
  41. gcc -o re re.o -lglib-2.0
  42.  
  43. re.o: re.c
  44. $(CC) -I<includes> -o $@ -c $^
  45.  
  46. re: re.o
  47. $(CC) $^ -l<libraries> -o $@
  48.  
  49. CFLAGS=$(shell pkg-config --cflags glib-2.0)
  50. LDLIBS=$(shell pkg-config --libs glib-2.0)
  51. CC=gcc
  52.  
  53. re: re.o
Add Comment
Please, Sign In to add comment