Going through the examples in examples/gtk I compiled them without problems but failed at running them because I was missing the cairo and gtk2 libraries. The first was actually on my hard disk, but I had to export LD_LIBRARY_PATH for it to be found. gtk2 was missing so I simply installed from macports.
The strange thing I found was that running "otool -L binary" is presumed to list all the linked libraries, but for the examples this only showed the libSystem.B library:
$ ./ex1 could not load: libcairo.dylib $ export LD_LIBRARY_PATH=/opt/local/lib/ $ ./ex1 $ otool -L ex1 ex1: /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 159.1.0) $
I wonder if this behaviour (library not showed by otool -L) is normal behaviour or is there something weird going on. I also wonder if this is something the nimrod compiler could check, that is, detecting the availability of the libraries at compile time to tell if the final binary can be run. Also, of interest would be if nimrod can create binaries statically linked, though I know this can't be done with gtk, but maybe it could with sqlite?
The purpose of these questions is to figure out if nimrod can create practical binaries with zero dependencies which could be sent over dropbox to another mac machine, and how I could test the runability on my machine without the need for a virtual machine reproducing the possibly library-less environment, or remote access to the user's system.
Nimrod uses dlsym or equivalent OS mechanisms for its dynlib feature. The advantage is that no -devel packages are required for building.
Static linking is possible (you can use --passl or edit nimrod.cfg for complete control over the build process) but requires changes to the wrappers. Patches are welcome.