minixml undefined reference to `mxmlNewXML'

ε祈祈猫儿з 提交于 2019-12-08 12:30:58

问题


I am having a problem getting the minixml library pulled into my project.

I followed the documentation on minixml page here http://www.minixml.org/documentation.php/install.html

There were no errors doing the install and I see the .h file in /usr/local/include/mxml.h and the assembly file in /usr/local/lib/libmxml.a

I have included mxml.h with #define<mxml.h> and it is finding that file no problem(as there are no errors from the mini xml types such as mxml_node_t etc...

I have also been compiling with -lmxml compile flag to link the library.

gcc -lpthread -lmxml    -o...and so forth

undefined reference to `mxmlNewXML'

Here is how I call the function, which matches the prototype:

mxmlNewXML("blah");

回答1:


i am also using this library. I suggested you to compile your code like this

by installing process you will get libmxml.a in your mxml package so now link that library with its whole path

gcc path_to_thatlibrary/libmxml.a -lpthread

Edit :

in your way does your code gets succesfully compile? what error it shows?



来源:https://stackoverflow.com/questions/7291698/minixml-undefined-reference-to-mxmlnewxml

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