개발자료/Linux Programming
[빌드 환경] glib openssl
배경남
2015. 7. 11. 17:16
glib.h
glib-object.h
openssl/crypto.h
위와 같은 header 를 포함하기 위해서는 아래 package 설치해야함
sudo apt-get install glib2.0-dev
sudo apt-get install libssl-dev
makefile 내용
CC = gcc
CFLAGS = -g -O0 $(shell pkg-config --cflags glib-2.0) $(shell pkg-config --cflags gobject-2.0) $(shell pkg-config --cflags openssl)
LDFLAGS = -lm $(shell pkg-config --libs glib-2.0) $(shell pkg-config --libs gobject-2.0) $(shell pkg-config --libs openssl)
SRC=$(wildcard *.c)
main: $(SRC)
$(CC) -o $@ $^ $(CFLAGS) $(LDFLAGS)
clean :
rm -f main *.o
위 내용이 없으면 아래와 같은 에러가 발생함
glib.h no such file or directory
glib-object.h no such file or directory
openssl/crypto.h no such file or directory