简体   繁体   English

如何在Eclipse Indigo CDT C ++中设置libxml

[英]How do I setup libxml in Eclipse Indigo CDT C++

This all is under Mac OS X 10.6 and the libxml libraries seem to be in /usr/local/libxml2/libxml, I added this to the GNU C++ support but still I get errors for the code that uses libxml. 这一切都在Mac OS X 10.6下,并且libxml库似乎在/ usr / local / libxml2 / libxml中,我将其添加到GNU C ++支持中,但我仍然得到使用libxml的代码的错误。 I couldn't find anything that explains what to do to get it working and my project to compile. 我找不到任何解释如何使其工作和我的项目编译。

edit: Example errors 编辑:示例错误

void printElementNames(xmlNode * a_node) {

}

This would give "Type xmlNode could not be resolved". 这将导致“无法解析类型xmlNode”。

I got this here: forum 我在这里得到了这个: 论坛

  1. Right-click your CDT project and select Properties . 右键单击CDT项目,然后选择“ 属性”
  2. Expand C/C++ General and select Paths and Symbols . 展开C / C ++ General并选择Paths and Symbols
  3. Select GNU C++ under Languages 在Languages下选择GNU C ++
  4. Click Add to define new element 单击“ 添加”以定义新元素
  5. Write in the Directory field /usr/local/libxml2/libxml 写入目录字段/ usr / local / libxml2 / libxml
  6. Re-build 重建

I'm working in the Cygwin environment, on Windows 7 (64bit), using Eclipse Kepler CDT for C++. 我正在使用Eclipse Kepler CDT for C ++在Windows 7(64位)的Cygwin环境中工作。

In Eclipse, goto 在Eclipse中,转到

Project --> Properties --> C++ Builder --> Settings --> Tool Settings Tab 项目 - >属性 - > C ++ Builder - >设置 - >工具设置选项卡

Cygwin C++ Linker --> Libraries Cygwin C ++链接器 - >库

In the Libraries (-l) add the file: xml2.dll 在库(-l)中添加文件: xml2.dll

In the Library search path (-L) add the path: "C:\\cygwin64\\lib" 在库搜索路径(-L)中添加路径: “C:\\ cygwin64 \\ lib”

Cygwin C++ Compiler --> Includes Cygwin C ++编译器 - >包含

In the Include paths (-I) add the path: "C:\\cygwin64\\usr\\include\\libxml2" 在Include路径(-I)中添加路径: “C:\\ cygwin64 \\ usr \\ include \\ libxml2”

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM