Sunday, 13 September 2015

Re: [gccsdk] dlopen query

> That means that either you have compiled one or more C source files
> without the -fPIC option or some hand written assembler (sys.s?)

Yes. I then put in the -fPIC flag for compiling the library and tried
again. This time I get errors of the kind

can't resolve symbol 'lua_setmetatable'

for each of the functions imported into the library.

So should I be using -fPIC also when compiling the interpreter?
What about -shared?

The interpreter uses the convention that, after a library 'foo'
has been loaded, the symbol (i.e. function name) to pass to
dlopen is 'luaopen_foo'. This means that library names have
to be valid identifiers in C, so I have rearranged things a bit
so that dots and backslashes can be avoided. Now I have
LUA_CPATH set to "/lua600:solib/?". The error messages I am now
getting are evidently about linking, so the problems of filenaming
appear to have been surmounted; for which many thanks.

--
Gavin Wraith (gavin@wra1th.plus.com)
Home page: http://www.wra1th.plus.com/

_______________________________________________
GCCSDK mailing list gcc@gccsdk.riscos.info
Bugzilla: http://www.riscos.info/bugzilla/index.cgi
List Info: http://www.riscos.info/mailman/listinfo/gcc
Main Page: http://www.riscos.info/index.php/GCCSDK

No comments:

Post a Comment