nadim
nadim

Reputation: 786

Ejabberd can't find include lib "p1_xml/include/

I have follow https://www.process-one.net/en/wiki/ejabberd_HTTP_request_handlers/ to create example, I have installed Ejabberd 14.07 on mac os. I have compile this program by using

erlc -I /Applications/ejabberd-14.07/lib/ejabberd-14.07/include -pz /Applications/ejabberd-14.07/lib/ejabberd-14.07/ebin mod_http_hello.erl

But when I compile I have found below Error Message.

/Applications/ejabberd-14.07/lib/ejabberd-14.07/include/jlib.hrl:22: can't find include lib "p1_xml/include/xml.hrl"
/Applications/ejabberd-14.07/lib/ejabberd-14.07/include/jlib.hrl:426: record xmlel undefined
/Applications/ejabberd-14.07/lib/ejabberd-14.07/include/jlib.hrl:466: type xmlel() undefined

I have Searched but didn't find any solution, If you any idea how to solve this error then guide me.

Upvotes: 0

Views: 2004

Answers (4)

user1418225
user1418225

Reputation:

From 15.03, in order to fix this you must add an argument to erlc: -DNO_EXT_LIB

Upvotes: 1

Kuryaki
Kuryaki

Reputation: 1011

i did the following to get it solved, at the source i ran ./rebar get-deps and ./rebar compile and then i copied the deps to the include folder

cp -R deps/* /lib/ejabberd/include/

after that i was able to compile my module just fine

Upvotes: 3

nadim
nadim

Reputation: 786

I have Solved this issue, this is not the proper solution for this error, but I have spent 2 days to solve this so to work ahead I have used this solution. You can see that xml.hrl file is not found, so I have copied file content to jlib.hrl file, where it is included and it shows no error.

If you are confused about that xml.hrl file is not available so How can the content be copied then for that you have to follow steps to install ejabberd using command line. When you run "make command" it will add all dependencies.

GO to deps -> p1_xml-> xml.hrl

Upvotes: 0

twester
twester

Reputation: 309

You missing some dependencies. Run ./rebar get-deps in the root of the ejaberd source directory and look in the ./deps directory.

Upvotes: 0

Related Questions