I am trying to compile this tool. The following is the beginning of his Makefile:
CC = gcc CFLAGS = -Wall -O2 -D TRACES DFLAGS = -g -Wall -o0 CPPFLAGS= $(INCLUDES:%=-I %) LDFLAGS = $(LIBRARIES:%=-L %) LDLIBS = $(USED_TOOLS:%=-l%) MY_FILES = INCLUDE_DIR = ~/include TOOLBOX_INC = $(INCLUDE_DIR)/tools TOOLBOX_LIB = $(TOOLBOX_INC) USED_TOOLS = std_io stringutils INCLUDES = $(TOOLBOX_INC) LIBRARIES = $(TOOLBOX_LIB)
I also have ~ / include / tools, which after compilation include std_io.o, libstd_io.a, stringutils.o and libstringutils.a
I get the following error:
gcc -L ~/include/tools rank.o counterexample.o -lstd_io -lstringutils -o rank ld: library not found for -lstd_io collect2: ld returned 1 exit status make: *** [rank] Error 1
I am not sure that things are not included correctly and why they do not find library files.
Edit:. I accidentally left a space between the -L and -I options. In addition, the paths should have been widened, I think. Now it works, thanks!
c makefile gnu-make
Sheerberenj
source share