Call a function in a shared library: Difference between revisions

m
→‎{{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
 
;idisappointment proto
 
.data
Line 2,295 ⟶ 2,293:
invoke printf, CSTR("--> Loading %s .. ",10), addr LibName
lea rax, 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}}==