简体   繁体   中英

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

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

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"

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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