Create and use a shared library
Posted: Fri Dec 09, 2016 12:14 pm
Could somebody please tell me what I'm doing wrong?
I compile this as hw.so...
...and try and call it like this (compiled as hwt):
I tried running it with the library side by side like this:
$ LD_LIBRARY_PATH=. ./hwt
that didn't work so I copied hw.so to /usr/lib, ran:
$ sudo ldconfig
but I still can't load my library.
I compile this as hw.so...
Code: Select all
ProcedureCDLL hw()
MessageRequester("Message","Hello, World!",0)
EndProcedureCode: Select all
If OpenLibrary(0,"hw.so")
CallCFunction(0,"hw")
CloseLibrary(0)
Else
MessageRequester("Oops","No Luck",0)
EndIf$ LD_LIBRARY_PATH=. ./hwt
that didn't work so I copied hw.so to /usr/lib, ran:
$ sudo ldconfig
but I still can't load my library.