Hi, I'm trying to compile a simple testing module for debian (x64, jessie), but require('module') gives me an error: [B]Couldn't load module library![/B]
After that I run the server with "[I]LD_LIBRARY_PATH=garrysmod/bin:bin:. LD_DEBUG=libs[/I]", and got this:
[CODE]28514: <...>/garrysmod/lua/bin/gmsv_testmodule_linux.dll: error: symbol lookup error: undefined symbol: _Z14Sys_GetFactoryPKc (fatal)
[ERROR] addons/testmodule/lua/autorun/autoload.lua:18: Couldn't load module library!
1. require - [C]:-1
2. unknown - addons/testmodule/lua/autorun/autoload.lua:18
[/CODE]
Module code:
[CODE]#include <Lua/Interface.h>
#include <tier1.h>
#include <eiface.h>
GMOD_MODULE_OPEN()
{
printf( "\n[*] Opening test module ...\n" );
auto engineFn = Sys_GetFactory( "engine.so" );
...
return 0;
}
GMOD_MODULE_CLOSE()
{
printf( "[*] Test module exited\n" );
return 0;
}
[/CODE]
Module info:
[CODE]$ ldd <...>/garrysmod/lua/bin/gmsv_testmodule_linux.dll
linux-gate.so.1 (0xf7704000)
libtier0.so => not found
libvstdlib.so => not found
libstdc++.so.6 => /usr/lib32/libstdc++.so.6 (0xf7601000)
libm.so.6 => /lib/i386-linux-gnu/i686/cmov/libm.so.6 (0xf75bb000)
libgcc_s.so.1 => /lib/i386-linux-gnu/libgcc_s.so.1 (0xf759e000)
libc.so.6 => /lib/i386-linux-gnu/i686/cmov/libc.so.6 (0xf73f1000)
/lib/ld-linux.so.2 (0xf7707000)
[/CODE]
IIRC Sys_GetFactory is defined in the tier1 library. Make sure your module is linking with tier1.a
There appears to be a missing referece to libtier0 and libvstdlib also.
[QUOTE=ph:lxyz;51194479]There appears to be a missing referece to libtier0 and libvstdlib also.[/QUOTE]
That actually has nothing to do with it. Those libraries will already be loaded into gmod by the time this module loads, and won't be an issue.
[QUOTE=Jcw87;51193949]IIRC Sys_GetFactory is defined in the tier1 library. Make sure your module is linking with tier1.a[/QUOTE]
Thank you, I've been change the linker order to "-l:tier1.a -lvstdlib -ltier0" and that's help.
Sorry, you need to Log In to post a reply to this thread.