Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $> make re
- 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
- /tmp/ccxas1nI.o: In function `print_uppercase_words':
- re.c:(.text+0x21): undefined reference to `g_regex_new'
- re.c:(.text+0x41): undefined reference to `g_regex_match'
- re.c:(.text+0x54): undefined reference to `g_match_info_fetch'
- re.c:(.text+0x6e): undefined reference to `g_print'
- re.c:(.text+0x7a): undefined reference to `g_free'
- re.c:(.text+0x8b): undefined reference to `g_match_info_next'
- re.c:(.text+0x97): undefined reference to `g_match_info_matches'
- re.c:(.text+0xa7): undefined reference to `g_match_info_free'
- re.c:(.text+0xb3): undefined reference to `g_regex_unref'
- collect2: ld returned 1 exit status
- make: *** [re] Error 1
- # Need to installed libglib2.0-dev some system specific install that will
- # provide a value for pkg-config
- INCLUDES=$(shell pkg-config --libs --cflags glib-2.0)
- CC=gcc $(INCLUDES)
- PROJECT=re
- # Targets
- full: clean compile
- clean:
- rm $(PROJECT)
- compile:
- $(CC) $(PROJECT).c -o $(PROJECT)
- $> glib-config
- No command 'glib-config' found, did you mean:
- Command 'gdlib-config' from package 'libgd2-xpm-dev' (main)
- Command 'gdlib-config' from package 'libgd2-noxpm-dev' (main)
- glib-config: command not found
- re.c:(.text+0xd6): undefined reference to `print_uppercase_words'
- void print_upppercase_words(const gchar *string)
- gcc -o re re.o -lglib-2.0
- re.o: re.c
- $(CC) -I<includes> -o $@ -c $^
- re: re.o
- $(CC) $^ -l<libraries> -o $@
- CFLAGS=$(shell pkg-config --cflags glib-2.0)
- LDLIBS=$(shell pkg-config --libs glib-2.0)
- CC=gcc
- re: re.o
Add Comment
Please, Sign In to add comment