You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
One way to avoid this problem would be to pin a foreign_library as completly included.
With a gcc toolchain: the main program has to be compiled with -cclib -Wl,--whole-archive -cclib lib_yourlib_.a -cclib -Wl,--no-whole-archive. On MSVC with -cclib /WHOLEARCHIVE:_yourlib_.lib.
I don't know if an handy way to make a library included in the executable could be implemented. One tricky point is that a package can provide a library and it is the main program which must use the whole archive flags.
There is a hack: using a static link with a dummy statical external declaration (see the constfun answer yallop/ocaml-ctypes#541)
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
When compiling an executable with a library (.a file), its content is not included if not statically linked. And Ctypes-foreign use dynamic linking.
Then following tiny example fails: https://gitlab.com/frederic.loyer/ctype_error
One way to avoid this problem would be to pin a foreign_library as completly included.
With a gcc toolchain: the main program has to be compiled with
-cclib -Wl,--whole-archive -cclib lib_yourlib_.a -cclib -Wl,--no-whole-archive
. On MSVC with-cclib /WHOLEARCHIVE:_yourlib_.lib
.I don't know if an handy way to make a library included in the executable could be implemented. One tricky point is that a package can provide a library and it is the main program which must use the whole archive flags.
There is a hack: using a static link with a dummy statical external declaration (see the constfun answer yallop/ocaml-ctypes#541)
Beta Was this translation helpful? Give feedback.
All reactions