dynamic libraries not enabled; check your Lua installation

本文记录了在安装和运行云风的Skynet过程中遇到的错误:动态库加载失败。问题出现在尝试加载skynet.c模块时,提示动态库不被支持。文章详细分析了错误原因,并指出这通常与Lua的安装配置有关。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

[plain] view plain copy
  1. [:1000001] LAUNCH logger   
  2. [:1000003] LAUNCH gate L ! 0.0.0.0:2013 5 256 0  
  3. [:1000002] LAUNCH master 0.0.0.0:2013  
  4. [:1000004] Harbor(0) connect to 127.0.0.1:2013  
  5. [:1000005] LAUNCH gate L ! 127.0.0.1:2526 5 256 0  
  6. [:1000004] LAUNCH harbor 127.0.0.1:2013 127.0.0.1:2526 1  
  7. [:1000006] LAUNCH localcast   
  8. [:1000007] LAUNCH snlua launcher  
  9. [:1000008] LAUNCH snlua main  
  10. [:1000008] lua do [main] error : error loading module 'skynet.c' from file './luaclib/skynet.so':  
  11.     dynamic libraries not enabled; check your Lua installation  
  12. stack traceback:  
  13.     [C]: in ?  
  14.     [C]: in function 'require'  
  15.     ./lualib/skynet.lua:1: in main chunk  
  16.     [C]: in function 'require'  
  17.     ./service/main.lua:1: in main chunk  
  18. [:1000007] lua do [launcher] error : error loading module 'skynet.c' from file './luaclib/skynet.so':  
  19.     dynamic libraries not enabled; check your Lua installation  
  20. stack traceback:  
  21.     [C]: in ?  
  22.     [C]: in function 'require'  
  23.     ./lualib/skynet.lua:1: in main chunk  
  24.     [C]: in function 'require'  
  25.     ./service/launcher.lua:1: in main chunk  
  26. [:1000008] KILL self  
  27. [:1000007] KILL self  
  28. [:1000002] Master connect to harbor(1) 127.0.0.1:2526  
  29. [:0] Drop message queue 1000007 (2 messages)  

在安装运行云风的skynet过程中出现这个错误

原因:lua加载c库会调用package.loadlib,官方文档中解释:This function is not supported by ANSI C. As such, it is only available on some platforms (Windows, Linux, Mac OS X, Solaris, BSD, plus other Unix systems that support the  dlfcn standard).
在loadlib.c的头部有如下说明:
/*
** $Id: loadlib.c,v 1.130 2017/01/12 17:14:26 roberto Exp $
** Dynamic library loader for Lua
** See Copyright Notice in lua.h
**
** This module contains an implementation of loadlib for Unix systems
** that have dlfcn, an implementation for Windows, and a stub for other
** systems.
*/
开始是用rudix安装的lua,后来重新从官网下载lua源代码编译 make macosx install 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值