I am trying to use the soft declare command to make calls into the Ocean Optics SeaBreeze library. It’s an open source project found on Source Forge. I’ve compiled SeaBreeze and produced a library. I’ve used functions from that library in an application coded in c to control a spectrometer. I’d like to do the same from Xojo but have been unable to do so.
const aLib ="/usr/lib/libc.dylib"
Soft Declare Function getpid Lib aLib () as Integer
A text search of the libseabreeze.dylib file reveals the sbapi_initialize string. The library file is found by Xojo, so it is not a problem with the file path. Is there a gcc compiler option that needs to be set so that Xojo can find functions in a library? I’m at a loss to explain why Xojo can’t find the function.
My thought as well, but I can call the function when coding with C. I’ve done several applications using the seabreeze API library in C. I thought, ‘Wouldn’t it be nice to have an interface for Xojo?’ I just assumed a soft declare would duplicate what I’d done in C, but no… I’m looking at gcc compiler options to see if something needs setting for Xojo.
I ran an nm and saw the symbols as expected. I’ve checked to see that the library exists at the path I gave to the soft declare as well. I’m trying to call a function called sbapi_initialize. Here’s part of the nm output:
0000000000102150 T _sbapi_get_stray_light_coeffs_features
0000000000101b10 T _sbapi_get_temperature_features
0000000000101900 T _sbapi_get_thermo_electric_features
0000000000100a30 T _sbapi_initialize
0000000000101800 T _sbapi_irrad_calibration_has_collection_area
0000000000101760 T _sbapi_irrad_calibration_read
Even System.IsFunctionAvailable( “sbapi_initialize”, “/usr/local/lib/libseabreeze.dylib” ) returns ‘false.’
I’ve already used the SeaBreeze library with Mac OS X, Yosemite. I wrote a daemon that runs on both Raspberry Pi, Raspbian and OS X, Darwin. I compiled the SeaBreeze API under both of those OS’s along with my daemon. The calls to the SeaBreeze API library from the daemon worked in both of those cases, but that code was written in C.
Renaming products sometimes has issues.
While the official name is now OS X, many people still continue to call it Mac OS or MacOS or Mac OS X.
Same happens to Xojo sometimes called RealBasic, REALbasic, RealStudio…
[quote=188305:@Eli Ott]MacOS was not renamed to, it was replaced by OS X. There fundamentally different OSs (OS X is UNIX based, MacOS was not).
But as the website says Seabreeze has been tested with MacOS 6.5 they must mean OS X 6.5, as there was no MacOS 6.5. Someone should tell them at some point…[/quote]
Ohh I was not even thinking to MacOS Classic
After MacOS (Classic), Mac OS X came then recently renamed to OS X (no Mac anymore)
Anyway, it’s clear they are talking of OS X, but this naming error is very common. I believe they mean Mac OS X 10.6.5