Skip to content

Instantly share code, notes, and snippets.

@ELLIOTTCABLE
Created May 20, 2022 16:41
Show Gist options
  • Save ELLIOTTCABLE/dec074c9946cd94b194ee46fa9046ca4 to your computer and use it in GitHub Desktop.
Save ELLIOTTCABLE/dec074c9946cd94b194ee46fa9046ca4 to your computer and use it in GitHub Desktop.
$ utop
Fatal error: cannot load shared library dlllwt_unix_stubs
Reason: dlopen(dlllwt_unix_stubs.so, 0x000A): tried: 'dlllwt_unix_stubs.so' (no such file), '/usr/local/lib/dlllwt_unix_stubs.so' (no such file), '/usr/lib/dlllwt_unix_stubs.so' (no such file), '/Users/ec/Desktop/dlllwt_unix_stubs.so' (no such file)
zsh: abort utop
$ opam sw
# switch compiler description
/Users/ec/Work/Code/semgrep ocaml-base-compiler.4.12.0 /Users/ec/Work/Code/semgrep
_globals System-global binaries
→ default ocaml-base-compiler.4.13.1 default
$ ocamlfind opt has_sockets.c
$ cc has_sockets.o
$ ./a.out
1
$ cat socket_type_table.c
#include <stdio.h>
extern int socket_type_table[];
int main()
{
printf("%i\n", socket_type_table[1]);
return 0;
}
$ ocamlfind opt -linkpkg -package unix socket_type_table.c
$ # all successful
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment