I have this folder structure:
Project_folder
Project_folder/Ml.app (folder)
Project_folder/Ml.lib (folder)
In the folder Ml.lib I've created a shared library named ml.so Now I want to link to the client application inside the Ml.app folder. Here's my makefile:
LIBS = -L ../Ml.lib -l ml
INCLUDES = ../Ml.lib
CXXLAGS = -Wall -I$(INCLUDES)
OBJFILES = main.o
TARGET = mltest
all: $(TARGET)
$(TARGET): $(OBJFILES)
$(CXX) $(CXXLAGS) -o $(TARGET) $(OBJFILES) $(LIBS) $(LDFLAGS)
clean:
rm -f $(OBJFILES) $(TARGET) *~
but when I try to build it I get
g++ -Wall -I../Ml.lib -o mltest main.o -L ../Ml.lib -l ml /usr/bin/ld: cannot find -lml collect2: error: ld returned 1 exit status make: *** [Makefile:8: mltest] Error 1
-L ... - Anonymous1847-l mlis wrong, should not have a space in there. - n. 1.8e9-where's-my-share m.-lmllooks for a file namedlibml.soand notml.so. - n. 1.8e9-where's-my-share m.