-
Notifications
You must be signed in to change notification settings - Fork 88
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
Compile error on .addConstructor(LUA_ARGS(_opt<std::string>)) #2
Comments
VA_ARGS does not expand correctly. Can you post the compile command line? It is more like you forget to enable some flags. |
Hey Steve, I figured out what the reason was, I had to use using namespace LuaIntf; in my code rather then using LuaIntf::LuaBinding(L), so now it's all working fine. I do have a other question if you don't mind: I am using boost I'm my application and noticed that the function LuaCppObjectFactory uses static cast, however I believe with boost you need to use static_pointer_cast. so I hacked it and changed it to : return boost::static_pointer_cast<CppObjectSharedPtr<SP, T>>(obj)->sharedPtr(); That seem to work fine, any suggestions for a proper fix? I was thinking to do something like |
No, it is not necessary, the original code works fine. boost::static_pointer_cast (and std::static_pointer_cast) is to cast However, I do find a bug in the static_cast of the following line: return static_cast<CppObjectSharedPtr<SP, T>>(obj)->sharedPtr(); should be: return static_cast<CppObjectSharedPtr<SP, T>*>(obj)->sharedPtr(); ah, miss a '*'. I really need to add more testing, I will add them later. |
Hello Steve, thanks for taking a look at this and tomorrow morning I am going to take a second look at the change I made and see if I can go without the change I made. Currently I have everything working with your library, and the use of shared pointer's , this is the code I am currently working on : https://github.com/rvt/kerneldev/blob/master/lcadluascript/cad/lualibrecadbridge.cpp Background, I am working on a new version of LibreCAD and with lua scripting we can start testing functionality without adding UI functionality by simply scripting it. |
Hey,
I am getting the below compile error.
What could be the cause of it?
I did add the lib as headers only, but also tried compiling as cpp.
Ries
The text was updated successfully, but these errors were encountered: