I am using a static library in which one of the modules employs the use of getaddrinfo().
When I link the library with an application, I get the following warning:
Code:
libSocket++.a(SocketUtility.o): In function `socketpp::FillAddress(int, char const*, unsigned short, sockaddr_in*)':
/home/whitneyd/Redirector/SocketLibrary-1.1.6/socket++/SocketUtility.cpp:114: warning: Using 'getaddrinfo' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
Is there any way to prevent this warning from occurring? I've tried linking the static version of the C library (/usr/lib/libc.a, by specifying "-static -lc" as one of my linker options, but that did not work.
Here is the Makefile I am using:
Code:
APP = udp_redir
SRCS = udp_redir.cpp
OBJS = $(SRCS:.cpp=.o)
CXXFLAGS = -Wall -pedantic -ansi
INCLUDES = -I./include
LDFLAGS = -L./lib
LIBS = -static -lSocket++ -static -lc
all: SocketLibrary $(APP)
$(APP): $(OBJS)
@echo Linking $@
@$(CXX) $^ $(LDFLAGS) $(LIBS) -o $@
.cpp.o:
@echo Compiling $<
@$(CXX) $(CXXFLAGS) $(INCLUDES) -c $<
clean:
@make -s -C SocketLibrary* DEST=.. clean
$(RM) $(OBJS)
distclean: clean
@make -s -C SocketLibrary* DEST=.. distclean
@$(RM) -r SocketLibrary*
@$(RM) ./.getLib
@$(RM) -r include lib
$(RM) $(APP)
SocketLibrary: .getLib
@echo Building SocketLibrary
@make -s -C SocketLibrary* DEST=.. install
.getLib:
@$(RM) -r SocketLibrary*
@wget http://softhouseproductions.com/SocketLibrary.tgz >& /dev/null
@tar xzf SocketLibrary.tgz
@$(RM) SocketLibrary.tgz
@touch $@