Trouble with C++ accessing NULL

29 views
Skip to first unread message

AlienCoder

unread,
Apr 19, 2016, 10:28:15 AM4/19/16
to Haxe
Hello community,

I have trouble with values that are NULL and have to be accessed in c++ anyway.

After a little research I found out that in former versions of c++ NULL wasn't implememented regularily.

So it had to be include by "stdlib.h" or "cstdlib"

#include <stdlib.h>

or

#include <cstdlib>

How do I do that in haxe?

I assume, it is a very simple procedure. I have also found the CFFI-Tutorial    But I have the impression that this solution is a little oversized for this purpose.

I feel a little overwhelmed and I am very thankfull for any help or hint.

Kind regards
Michael

Anton Nesterov

unread,
Apr 19, 2016, 10:40:16 AM4/19/16
to Haxe
Use @:include metadata. See RGB.hx#L6
Btw, C++ has NULL constant in order to retain compatibility with C. You can use 0 constant instead.

вторник, 19 апреля 2016 г., 17:28:15 UTC+3 пользователь AlienCoder написал:

AlienCoder

unread,
Apr 19, 2016, 10:51:46 AM4/19/16
to Haxe
Hello Anton,

thank you very much.

Now, everything works fine. And it really was a simple solution ;-)

Kind regards
Arnim
Reply all
Reply to author
Forward
0 new messages