Anonymous user
Call a function in a shared library: Difference between revisions
Call a function in a shared library (view source)
Revision as of 04:03, 26 October 2021
, 2 years ago→{{header|X86-64 Assembly}}: added output.. forgot to preview D:
(It opens a library?) |
m (→{{header|X86-64 Assembly}}: added output.. forgot to preview D:) |
||
Line 2,284:
ENDMETHOD
endif
.data
Line 2,295 ⟶ 2,293:
invoke printf, CSTR("--> Loading %s .. ",10), addr LibName
mov ldr, _NEW(libldr, addr LibName, sizeof(LibName))
ldr->getproc(CSTR("disappointment"))
Line 2,317 ⟶ 2,314:
</lang>
It's worth pointing out that under linux, dlopen CAN return NULL WITHOUT it being an error. One SHOULD call dlerror() to check for actual errors.
{{out}}
<pre>
--> Loading ./somelib.l ..
--> Well this is a external disappointment..
And on failure...
--> Loading ./somelib.l ..
--> Failed to load library ./somelib.l
--> Well this is a internal disappointment..
</pre>
=={{header|zkl}}==
|