How do I include and link libxml2 using CMakeLists?
Solved
General and Desktop
-
What is the correct way to include and link libxml2?
I'm not able to find any sample code, and what I've tried results in a:
:-1: error: cannot find -lLibXml2 :-1: error: collect2: error: ld returned 1 exit status
This is what I have in my CMakeLists.txt
... find_package(LibXml2 REQUIRED) include_directories(/usr/include/libxml2) link_libraries(LibXml2) target_link_libraries(xxx PRIVATE Qt5::Widgets Qt5::Network Qt5::Gui LibXml2::LibXml2 )
-
@txtsd said in How do I include and link libxml2 using CMakeLists?:
link_libraries(LibXml2)
This is wrong and not needed at all.