Joe Lin
Joe Lin

Reputation: 496

Erlang C-Node erl_errno symbol not found error

I tried to use erl_errno as described in the erlang document: http://erlang.org/doc/man/erl_error.html#.

However, I'm getting a symbol not found problem during linking. I'm running on Mac and here's the how the program is linked:

g++ -L/usr/local/lib/erlang/lib/erl_interface-3.9.3/lib -o "roserl" ./src/driver.o ./src/erl_bridge.o -lei -lm -lerl_interface

I have already linked with libei and liberl_interface. What else is needed?

Upvotes: 2

Views: 149

Answers (1)

Overbryd
Overbryd

Reputation: 5006

It is weird but you will have to do this in your header:

#ifndef _REENTRANT
#define _REENTRANT /* For some reason __erl_errno is undefined unless _REENTRANT is defined */
#endif

#include "erl_interface.h"
#include "ei.h"

This fixed the problem for me. Now I can use erl_errno.

Upvotes: 4

Related Questions