gcc/g++ 链接库的编译与链接 -lxerces-c

https://www.cnblogs.com/jadeshu/articles/10663512.html

#include <xercesc/util/PlatformUtils.hpp>
// Other include files, declarations, and non-Xerces-C++ initializations.

using namespace xercesc;

int main(int argc, char* argv[])
{
  try {
    XMLPlatformUtils::Initialize();
  }
  catch (const XMLException& toCatch) {
    // Do your failure processing here
    return 1;
  }

  // Do your actual work with Xerces-C++ here.

  XMLPlatformUtils::Terminate();

  // Other terminations and cleanup.
  return 0;
}

freebsd 编译 xerces-c

 cmake .. -Dtranscoder=icu  

c++ main.cpp -I/usr/local/include -L/usr/local/lib -lxerces-c

 

posted @ 2024-08-31 14:43  微笑的''80  阅读(7)  评论(0)    收藏  举报