luaopen io 失敗解決方法

2021-05-12 09:58:48 字數 481 閱讀 4979

網上搜的,轉過來。

初學 lua ,在 vs2005 下 , lua 5.1.3 。

遇到了不少問題。教程 4.0 的,示例不能直接在 5.1.3 上用 。 5.1.3裡面 dofile 和 dostring 函式被lual_dofile和lual_dostring取代了。無奈,捨棄教程。

找了一篇 5.x 的教程,還是問題。首先,找不到 luaopen_loadlib ; 其次,執行到 luaopen_io 就 down 掉了。google了很久,看了很多中文英文帖子,都沒有實際解決。特發此帖,講述一下我的解決方法。

對於第乙個問題,看下 lualib.h 才知道 luaopen_package代替了luaopen_loadlib

對於第二個問題,參考下 linit.c 的**才發現應該用 lua_pushcfunction(l, luaopen_io);lua_pushstring(l, lua_iolibname);lua_call(l, 1, 0); 代替。

ROSCORE 失敗解決方法

啟動roscore出現如下錯誤 warning unable to configure logging.no log files will be generated checking log directory fordisk usage this may take awhile press ctr...

SVN clean失敗解決方法

一 問題描述 1.svn 更新或者提交時,報錯 svn cleanup failed previous operation has not finished run cleanup if it was interrupted 提醒先clean up 2.當clean up時,報錯如下 二 問題原因 ...

Ubuntu su認證失敗解決方法

ubuntu su 認證失敗解決方法 su 認證失敗的解決方法 ubuntu 安裝後,root 使用者預設是被鎖定了的,不允許登入,也不允許 su 到 root 有人說這是個不好的實踐,特別是對於伺服器來說。我覺得對於桌面使用者來說,這樣安全性更高一些,是應該的 但對於伺服器可以設定成 允許 su ...