【发布时间】:2012-12-25 06:38:09
【问题描述】:
可能重复:
Are there general guidlines for solving undefined reference/unresolved symbol issues?
我想转换一个 xml 来插入 sql 语句。我已经准备好 xml 和 xslt 文件,并且我知道转换运行正常(用 Oxygen 测试)。
现在,我用 c++ 编码这个转换没有成功。
我已尝试包含以下库:
#include <libxml2/libxml/xmlversion.h>
#include <libxml2/libxml/parser.h>
#include <libxml2/libxml/valid.h>
#include <libxml2/libxml/xmlschemastypes.h>
#include <libxml2/libxml/xmlschemas.h>
#include <libxml2/libxml/xmlmemory.h>
#include <libxml2/libxml/debugXML.h>
#include <libxml2/libxml/HTMLtree.h>
#include <libxml2/libxml/xmlIO.h>
#include <libxml2/libxml/DOCBparser.h>
#include <libxml2/libxml/xinclude.h>
#include <libxml2/libxml/catalog.h>
#include <xalanc/Include/PlatformDefinitions.hpp>
#include <xercesc/util/PlatformUtils.hpp>
#include <xalanc/XalanTransformer/XalanTransformer.hpp>
但是编译器在代码中显示了很多错误,例如:
/home/kimpa2007/xml/src/main.cc:108: undefined reference to `xercesc_2_8::XMLUni::fgXercescDefaultLocale'
/home/kimpa2007/xml/src/main.cc:109: undefined reference to `xalanc_1_10::XalanTransformer::initialize(xercesc_2_8::MemoryManager&)'
有人可以用简单的方式解释如何对这种转换进行编码吗?
【问题讨论】:
-
谢谢,但我对修复“未定义引用”问题不感兴趣。我只是想要一种简单的方法来进行转换。
-
XSLT 是一种与任何转换 XML 一样好的方法。
-
另见:en.wikipedia.org/wiki/Extract,_transform,_load 和 kettle.pentaho.com。为什么要重新发明轮子?