Static link
Hi, By default FLTK library is linked dynamically. How can I create a statically linked image of my nim program? Thanks
Depending on the environment, change the name of the library the module links to and possibly add some C defines so the FLTK headers know you are doing a static build.
https://github.com/Skrylar/nfltk/blob/d1b497d74a3be64a11e8b819a482022c611bcfe0/fltk.nim#L2
I am on Mac OS X.
I tried to replace Line 2 in fltk.nim with:
{.passL: "/usr/local/Cellar/fltk/1.3.5/lib/libfltk.a -lpthread -framework Cocoa".}
(It is the options returned by fltk-config --ldstaticflags command)
No luck, the linker says:
duplicate symbol _FL_NORMAL_SIZE in:
/Users/peter/.cache/nim/testpeter_d/@[email protected]
/usr/local/Cellar/fltk/1.3.5/lib/libfltk.a(Fl_Widget.o)
ld: 1 duplicate symbol for architecture x86_64
Sure, the symbol is defined in both files.
I tried to add --dynlibOverrideAll to build command, but it changes nothing.