First the Makefile here had
CFLAGS = -g -Wall -lm
I was playing with C that time. Now I'm on C++ and I have to add -I eigen, quick google on it and found CXXFLAGS exist for the C++ world, while CFLAGS exist for the C world. So I updated Makefile to
CFLAGS = -g -Wall -lm
CXXFLAGS = -I eigen
Then I found https://wiki.gentoo.org/wiki/GCC_optimization, and was inspired to updated it again
CFLAGS = -g -Wall -lm
CXXFLAGS = ${CFLAGS} -I eigen
The complete thing:
CC = g++
CFLAGS = -g -Wall -lm
CXXFLAGS = ${CFLAGS} -I eigen
OBJS = main.o multiply.o
PROGRAM = multitply
$(PROGRAM): $(OBJS)
$(CC) $(OBJS) $(CFLAGS) -o $(PROGRAM)
Should I add -I eigen to CXXFLAGS or CFLAGS?
Aucun commentaire:
Enregistrer un commentaire