I am trying to compile some C wrapper functions to Python 3.4 using gcc and makefile, but I am having no success in finding the correct compile and link flags. I am using Ubuntu 14
Right now this is what I was trying in the makefile:
CC = gcc
CFLAGS = -Wall -std=c99 `pkg-config --cflags python3`
LDFLAGS = `pkg-config --libs python3`
final: functions.o wrapper.o
$(CC) -o functions.o $(CFLAGS) $(LDFLAGS)
functions.o: functions.c functions.h
$(CC) $(CFLAGS) -c functions.c
wrapper.o: wrapper.c
$(CC) $(CFLAGS) -g -c wrapper.c
Using this get me this error:
/usr/bin/ld: /usr/local/lib/libpython3.4m.a(dynload_shlib.o): undefined reference to symbol 'dlsym@@GLIBC_2.2.5'
//lib/x86_64-linux-gnu/libdl.so.2: error adding symbols: DSO missing from command line
Also, I have little experience in makefiles, so I don't if I have done something wrong along the way