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

Errors compiling using Clang #19

Open
jefvel opened this issue Dec 23, 2019 · 0 comments
Open

Errors compiling using Clang #19

jefvel opened this issue Dec 23, 2019 · 0 comments

Comments

@jefvel
Copy link

jefvel commented Dec 23, 2019

I am trying to compile bullet using webidl with Clang, but I'm getting these errors:

/Users/jefvel/project/libs/bullet/src/bullet.cpp:35:21: error: pasting formed 'u"delete() is not allowed on const value."', an invalid preprocessing token
        if( !r->finalize ) hl_error("delete() is not allowed on const value.");
                           ^
/Users/jefvel/project/libs/bullet/../../hashlink/src/hl.h:586:55: note: expanded from macro 'hl_error'
#define hl_error(msg, ...) hl_throw(hl_alloc_strbytes(USTR(msg), ## __VA_ARGS__))
                                                      ^
/Users/jefvel/project/libs/bullet/../../hashlink/src/hl.h:234:21: note: expanded from macro 'USTR'
#       define USTR(str)        u##str
                                 ^
/Users/jefvel/project/libs/bullet/src/bullet.cpp:35:21: error: use of undeclared identifier 'u'
/Users/jefvel/project/libs/bullet/../../hashlink/src/hl.h:586:55: note: expanded from macro 'hl_error'
#define hl_error(msg, ...) hl_throw(hl_alloc_strbytes(USTR(msg), ## __VA_ARGS__))
                                                      ^
/Users/jefvel/project/libs/bullet/../../hashlink/src/hl.h:234:20: note: expanded from macro 'USTR'
#       define USTR(str)        u##str
                                ^
/Users/jefvel/project/libs/bullet/../../hashlink/src/hl.h:234:20: note: expanded from macro 'u'
/Users/jefvel/project/libs/bullet/src/bullet.cpp:43:16: error: assigning to 'void *' from incompatible type 'void (*)(pref<btVector3> *)'
        r->finalize = finalize;
                      ^~~~~~~~
/Users/jefvel/project/libs/bullet/src/bullet.cpp:557:9: note: in instantiation of function template specialization '_alloc_ref<btVector3>' requested here
        return alloc_ref((new btVector3()),btVector3);
               ^
/Users/jefvel/project/libs/bullet/src/bullet.cpp:30:24: note: expanded from macro 'alloc_ref'
#define alloc_ref(r,t) _alloc_ref(r,finalize_##t)

...

(It continues with a lot more error: assigning to 'void *' from incompatible type ' X errors.)

I managed to circumvent this and successfully compile by using gcc and setting the flag -fpermissive, but I'm wondering if there could be some way to make it work in Clang directly.

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

1 participant