How do I setup libxml in Eclipse Indigo CDT C++

时光毁灭记忆、已成空白 提交于 2019-12-11 11:02:45

问题


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. 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".


回答1:


I got this here: forum

  1. Right-click your CDT project and select Properties.
  2. Expand C/C++ General and select Paths and Symbols.
  3. Select GNU C++ under Languages
  4. Click Add to define new element
  5. Write in the Directory field /usr/local/libxml2/libxml
  6. Re-build



回答2:


I'm working in the Cygwin environment, on Windows 7 (64bit), using Eclipse Kepler CDT for C++.

In Eclipse, goto

Project --> Properties --> C++ Builder --> Settings --> Tool Settings Tab

Cygwin C++ Linker --> Libraries

In the Libraries (-l) add the file: xml2.dll

In the Library search path (-L) add the path: "C:\cygwin64\lib"

Cygwin C++ Compiler --> Includes

In the Include paths (-I) add the path: "C:\cygwin64\usr\include\libxml2"



来源:https://stackoverflow.com/questions/7584139/how-do-i-setup-libxml-in-eclipse-indigo-cdt-c

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!