I was trying to load my own custom binary, and I used some sample code from the PIL 2nd edition, and edited a bit because I using Lua 5.2.
I am using Ubuntu 12.04 64-bit, and I managed to compile the binary just fine, but when I call require to load it, I get the error:
Lua 5.2.0 Copyright (C) 1994-2011 Lua.org, PUC-Rio
> require'test'
error loading module 'test' from file './test.so':
./test.so: cannot dynamically load executable
stack traceback:
[C]: in ?
[C]: in function 'require'
stdin:1: in main chunk
[C]: in ?
I have no idea as to why this would happen, I've spent hours looking around google to no avail.
I have attached the code I am using, and I compile with GCC using g++ dir.cpp -o test.so -llua
Any help is greatly appreciated.