我最近尝试在我的OpenDDS c ++项目中包含libxml2。
但是,我不知道如何将这个库包含在 GNUMakefile 上。
我怎样才能在这个 GNUmake 文件中包含 libxml2?
另外,我尝试像这样在 GNUMakefile 上添加命令。
LIB = /usr/local/xml/lib
但是,仍然不起作用。
我的 GNUMakefile 在这里:
MAKEFILE = GNUmakefile.DDS_Messenger_Publisher
DEPENDENCY_FILE = .depend.DDS_Messenger_Publisher
BIN_UNCHECKED = publisher
LIB_PREFIX ?= lib
TAO_ROOT ?= $(ACE_ROOT)/TAO
FILES =
publisher.cpp
Writer.cpp
LIBPATHS := . "$(ACE_ROOT)/lib" "../../../lib"
#----------------------------------------------------------------------------
# Include macros and targets
#----------------------------------------------------------------------------
LDLIBS = -lDDS_Messenger_Idl -lOpenDDS_Shmem -lOpenDDS_Rtps_Udp -lOpenDDS_Rtps -lOpenDDS_Multicast -lOpenDDS_Udp -lOpenDDS_Tcp -lOpenDDS_InfoRepoDiscovery -lOpenDDS_Dcps -lTAO_BiDirGIOP -lTAO_PI -lTAO_CodecFactory -lTAO_PortableServer -lTAO_AnyTypeCode -lTAO -lACE
TAO_IDL = $(ACE_ROOT)/bin/tao_idl
TAO_IDL_DEP = $(ACE_ROOT)/bin/tao_idl$(EXEEXT)
TAO_IDLFLAGS = -Wb,pre_include=ace/pre.h -Wb,post_include=ace/post.h -I$(TAO_ROOT)$(if $(ARCH), -g $(call ADD_QUOTE,$(call ADD_ARCH,$(ACE_ROOT)/bin/ace_gperf)))
PRJ_TYPE = rtp
ifeq ($(INSBIN),.)
ifeq ($(CURDIR),)
ifeq ($(PWD),)
PWD=$(shell pwd)
endif
else
PWD=$(CURDIR)
endif
INSBIN = $(PWD)
endif
OUTPUT_DIRECTORY = $(if $(ARCH),./$(ARCH))
include $(ACE_ROOT)/include/makeinclude/wrapper_macros.GNU
include $(DDS_ROOT)/rules.dds.GNU
include $(TAO_ROOT)/rules.tao.GNU
...
...
我终于解决了这个问题。
刚刚添加
LIBXML_ROOT ?= /usr/local/xml
LDLIBS = -lDDS_Messenger_Idl -lOpenDDS_Shmem ... -L$(LIBXML_ROOT)/lib -lxml2
...
CPPFLAGS += -I$(ACE_ROOT) -I$(TAO_ROOT) -I../../.. -I$(LIBXML_ROOT)/include/libxml2