These are chat archives for ChaiScript/ChaiScript

27th
May 2015
patlecat
@patlecat
May 27 2015 09:55
@lefticus I get this error thrown while trying to Debug: throw chaiscript::exception::load_module_error("Unable to find module: " + t_module_name + " Errors: " + errstring); But what module is it talking about?
patlecat
@patlecat
May 27 2015 10:06
When I run the exe with print("Dr. Bob"); then the exe crashes on Windows and disappears without any further error.
patlecat
@patlecat
May 27 2015 10:20
MSVC2013 x64 on Windows 8.1 64bit used, btw
Jason Turner
@lefticus
May 27 2015 13:12
@patlecat Based on what you wrote, I would assume you are in the VisualStudio debugger. Inside of the debugger, if you have that message, you can simply mouse-over the t_module_name and see the name of the module it's trying to find. Unless something is very broken, it's trying to find the stdlib module. Please try this method of constructing the chaiscript object that I mentioned in the last note: https://gist.github.com/lefticus/9456197#file-chaiscript_compiled_in_stdlib-cpp-L11
Ok, really weird that it's posting a picture of me - but that link goes to a gist
patlecat
@patlecat
May 27 2015 13:25
Thanks for the pic ;) hehehe
Is this chai object not the script-context? I thought it is and therefore thought it best to save it as a class member instead of recreating it everytime a script is executed.
patlecat
@patlecat
May 27 2015 13:35
Now with your suggestion I have this compile error: fatal error C1128: number of sections exceeded object file format limit : compile with /bigobj?
patlecat
@patlecat
May 27 2015 13:56
After a number of warnings like this:
1>c:\development\qt5\chaiscripter\chaiscript\include\chaiscript\dispatchkit\any.hpp(71): warning C4503: 'std::allocator<_Other>::destroy' : decorated name length exceeded, name was truncated
1>          with
1>          [
1>              _Other=std::_Func_impl<_MyWrapper,std::allocator<std::_Func_class<std::shared_ptr<std::map<std::string,chaiscript::Boxed_Value,std::less<std::string>,std::allocator<std::pair<const std::string,chaiscript::Boxed_Value>>>>,const std::map<std::string,chaiscript::Boxed_Value,std::less<std::string>,std::allocator<std::pair<const std::string,chaiscript::Boxed_Value>>> &>>,std::shared_ptr<std::map<std::string,chaiscript::Boxed_Value,std::less<std::string>,std::allocator<std::pair<const std::string,chaiscript::Boxed_Value>>>>,const std::map<std::string,chaiscript::Boxed_Value,std::less<std::string>,std::allocator<std::pair<const std::string,chaiscript::Boxed_Value>>> &>
1>          ]
1>c:\development\qt5\chaiscripter\chaiscript\include\chaiscript\dispatchkit\any.hpp(71): warning C4503: 'std::move' : decorated name length exceeded, name was truncated
Jason Turner
@lefticus
May 27 2015 14:42
I'm really not sure what you're asking about the script context. If you create a new ChaiScript object, it's going to have a new context. Re: bigobj, do what it says. You need to add /bigobj on MSVC. You can also disable those "decorated name length exceeded" warnings. They are painful and have no place with modern C++. These are the flags I set for MSVC https://github.com/ChaiScript/ChaiScript/blob/develop/CMakeLists.txt#L156-L171 The last two are the ones you care about. /bigobj and /wd4503
patlecat
@patlecat
May 27 2015 15:01
ok those flags worked, it compiles now both Rel + Deb. The Release version will output : Error with function dispatch after entering the command: print("helo"); and the Debug version will not run with the error: R6010 - abort() has been called
About the script object being the context. You create it on the stack, but how to create it on the heap and keep it to be reused? Because now it will be destroyed once the c++ function ends.
Jason Turner
@lefticus
May 27 2015 16:07
You could make it a member of the object that contains it. Or use shared_ptr. Now that you have a fully compiling / running example you can check it in somewhere maybe as branch on your project or a new project and I can look at why this function dispatch error is occurring with you
patlecat
@patlecat
May 27 2015 16:54
Ok