I am having trouble getting the correct link to a sample program (in this case, against the ICU library). When I do, everything builds perfectly. But when I run it, it says that it cannot find one of .so. I double checked that they are all installed in / usr / local / lib. I found that he was browsing / usr / lib. If I symbolically link the actual location from there, it works.
Why are my LIBPATHS ignored or not used?
Here is the makefile
CC = g++
INCPATHS = -I/usr/local/include
CFLAGS = -c -Wall $(INCPATHS)
LIBPATHS = -L/usr/local/lib/
LIBS = $(LIBPATHS) -licuio -licui18n -licuuc -licuio -licudata
EXECUTABLE = prog
print_linking = echo -e "\033[32m" "Linking: $<" "\033[39m"
print_compiling = echo -e "\033[33m" "Compiling: $<" "\033[39m"
print_cleaning = echo -e "\033[31m" "Cleaning: `pwd`" "\033[39m"
all: main
main: main.o
@$(print_linking)
@$(CC) -o $(EXECUTABLE) main.o $(LIBS) >> /dev/null
main.o: main.cpp
@$(print_compiling)
@$(CC) $(CFLAGS) main.cpp
clean:
@$(print_cleaning)
@rm -rf *.o *~ $(EXECUTABLE)
source
share