How do I setup libxml in Eclipse Indigo CDT C++
This all is under Mac OS X 10.6 and the libxml librar开发者_Python百科ies 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
- Right-click your CDT project and select Properties.
- Expand C/C++ General and select Paths and Symbols.
- Select GNU C++ under Languages
- Click Add to define new element
- Write in the Directory field /usr/local/libxml2/libxml
- 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"
精彩评论