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

which version of libclang needed? #2

Open
justincormack opened this issue Jan 6, 2013 · 3 comments
Open

which version of libclang needed? #2

justincormack opened this issue Jan 6, 2013 · 3 comments

Comments

@justincormack
Copy link
Contributor

I get build errors:

[100%] Building CXX object CMakeFiles/luaclang-parser.dir/luaclang-parser.cpp.o
/home/justin/lua/luaclang-parser/luaclang-parser.cpp: In function ‘void pushDiagnostic(lua_State*, CXDiagnostic)’:
/home/justin/lua/luaclang-parser/luaclang-parser.cpp:70:57: error: ‘clang_getDiagnosticCategoryText’ was not declared in this scope
/home/justin/lua/luaclang-parser/luaclang-parser.cpp: In function ‘int l_parseTU(lua_State*)’:
/home/justin/lua/luaclang-parser/luaclang-parser.cpp:136:77: error: ‘CXTranslationUnit_SkipFunctionBodies’ was not declared in this scope
/home/justin/lua/luaclang-parser/luaclang-parser.cpp: In function ‘const char* cursorKindStr(CXCursorKind)’:
/home/justin/lua/luaclang-parser/luaclang-parser.cpp:370:10: error: ‘CXCursor_VariableRef’ was not declared in this scope
/home/justin/lua/luaclang-parser/luaclang-parser.cpp:419:10: error: ‘CXCursor_LambdaExpr’ was not declared in this scope
/home/justin/lua/luaclang-parser/luaclang-parser.cpp:420:10: error: ‘CXCursor_ObjCBoolLiteralExpr’ was not declared in this scope
/home/justin/lua/luaclang-parser/luaclang-parser.cpp:449:10: error: ‘CXCursor_MSAsmStmt’ was not declared in this scope
/home/justin/lua/luaclang-parser/luaclang-parser.cpp:460:10: error: ‘CXCursor_AsmLabelAttr’ was not declared in this scope
/home/justin/lua/luaclang-parser/luaclang-parser.cpp: In function ‘int l_arguments(lua_State*)’:
/home/justin/lua/luaclang-parser/luaclang-parser.cpp:502:58: error: ‘clang_Cursor_getNumArguments’ was not declared in this scope
/home/justin/lua/luaclang-parser/luaclang-parser.cpp:506:47: error: ‘clang_Cursor_getArgument’ was not declared in this scope
make[2]: *** [CMakeFiles/luaclang-parser.dir/luaclang-parser.cpp.o] Error 1
make[1]: *** [CMakeFiles/luaclang-parser.dir/all] Error 2
make: *** [all] Error 2

This is using the version of clang that ships with Ubuntu 12.10 (3.0 I think). Do I need a more recent version?

@mkottman
Copy link
Owner

mkottman commented Jan 6, 2013

On 6 January 2013 20:27, Justin Cormack [email protected] wrote:

I get build errors:

This is using the version of clang that ships with Ubuntu 12.10 (3.0 I think). Do I need a more recent version?

Hmm, I built it using clang 3.1, unfortunately these weren't available
before. If the values are not essential to you, remove them (cases in
cursorKindStr
and clang_getDiagnosticCategoryText and l_arguments) and recompile.

@justincormack
Copy link
Contributor Author

I made a tiny patch here https://github.com/justincormack/luaclang-parser to work with the Ubuntu 3.1 PPAs and thats working fine.

I am giving a short talk about using this to generate bindings next week. If you have any tips that would be useful. I must look through your qt binding code in more detail too.

@mkottman
Copy link
Owner

Please issue a pull request and I will merge it, the change seems trivial and special enough not to influence anything important.

Regarding the binding code, there is actually no binding done yet using luaclang-parser, however there is some special logic in qt4-qobjectdefs-injected.h to recognize Qt signals and slots. lqt uses a custom C++ parser which outputs XML and a custom generator dealing with various kinds of C++ magic. The code looks a bit ugly, if there is anything you'd like to know just ask.

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