简体   繁体   中英

Calling lua from a c program get a nil value (global 'pcall')

here is lua code:

function calc (x, y)
    return (x^2 * y)
end

pcall(calc,10,20)

when i run dofile get error:attempt to call a nil value (global 'pcall') my lua version is lua5.4.0 how can i fix this problem

Ok.I have fixed it already.I called clua_hide_pcall before dofile,My mistake... Thanks for anwser my question!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM