For the life of me, I blew 12 hours yesterday trying to get a dylib to work.
I have a SmartDongle and it works well with windows. On the Mac side, it comes with a libsmartdongle.dylib library.
But, if I use the example Xojo app and reference this library, I keep getting FunctionNotFound Exception, it cannot see any of the functions! The library is written in C, and uses LIBUSB.
So I downloaded the source code, had to make some serious changes in the makefile to support the later xcode running on my Sierra machine. I couldnt compile the i386 side of the code, but I was able to compile the X86_64 side though. Referenced the newly compiled library, nothing. Still function not found error!!
So to make sure I am not going entirely insane, I tried roughing up a quick and dirty Excel VBA app to reference the lib, I kept getting run time error 53, file not found. No matter where I stick that stupid dylib, nothing can see it! So I put the dylib with the App executable, and did a FolderItem get Item and it says its there. But, if I reference it in the Soft Declare, Function Not Found. I put that dylib everywhere I possibly could. disabled system integrity so I could dump it in /usr/lib, even dumped it in /usr/local/lib as well, dumped it in my Documents folder, Hard Drive root, and even the application directory. Nothing works!
The library is written in C and compiled in C, so the “Extern C” fix doesn’t apply here. And even if it did, its referenced in the Source Code. I took the original library and ran some command line tools on it to make sure the functions werent mangled, and they are not. Also, it IS in fact a universal binary with i386 and x86_64, No PowerPC code at all.
I am at a loss! Any ideas? Also if i compile the example C code that comes with the dylib source code, I can access the dongle no problem. but Xojo just wont take this dylib whatsoever. As a last-ditch effort, I tried setting the Environment to compile in 64-bit mode instead of 32 but it made no difference.
I grabbed a MacBook Air which is still on 10.10 instead of 10.12, and all the same problems still exist. What I cannot understand is the App compiles with a bunch of its own Dylibs for the Xojo framwork, etc. and obviously those work or the App wouldnt run! I dont get it…
I would attach the Dylib, but I dont see an attach function. You can however, get it here:
http://www.smartdongle.com/sites/default/files/uploads/SmartDongle_RealStudio.zip