Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Does not work using C++ #33

Closed
sarahkittyy opened this issue Apr 20, 2021 · 2 comments
Closed

Does not work using C++ #33

sarahkittyy opened this issue Apr 20, 2021 · 2 comments

Comments

@sarahkittyy
Copy link

I'd like to use this library in my C++ project but due to some conversions that are only valid in C it won't compile:

ext/librg/librg.h|19756 col 20| error: cannot initialize a variable of type 'librg_world_t *' with an rvalue of type 'void *'
||     librg_world_t *wld = LIBRG_MEM_ALLOC(sizeof(librg_world_t));
||                    ^     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
ext/librg/librg.h|19918 col 45| error: cannot initialize return object of type 'librg_event_type' with an rvalue of type 'int'
||     LIBRG_ASSERT(event); if (!event) return LIBRG_EVENT_INVALID;
||                                             ^~~~~~~~~~~~~~~~~~~
ext/librg/librg.h|2177 col 41| note: expanded from macro 'LIBRG_EVENT_INVALID'
|| #define LIBRG_EVENT_INVALID             (-0x0006)
||                                         ^~~~~~~~~
ext/librg/librg.h|19921 col 12| error: cannot initialize return object of type 'librg_event_type' with an lvalue of type 'uint8_t' (aka 'unsigned char')
||     return e->type;
||            ^~~~~~~
ext/librg/librg.h|20656 col 14| error: cannot initialize a variable of type 'int64_t *' (aka 'long *') with an rvalue of type 'void *'
||     int64_t *results = LIBRG_MEM_ALLOC(LIBRG_WORLDWRITE_MAXQUERY * sizeof(int64_t));
||              ^         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|| 4 errors generated.
@inlife
Copy link
Member

inlife commented Apr 20, 2021

Hey,

Fortunately, that is something fixable!
Could you try out this build: librg.h.zip

@inlife
Copy link
Member

inlife commented Apr 22, 2021

The issue is solved in https://github.com/zpl-c/librg/releases/tag/v6.0.12

@inlife inlife closed this as completed Apr 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants