LimeLM
wyBuild
Support forum
wyDay blog
wyDay Home

Using TurboActivate & TurboFloat on macOS (Mac OS X)

TurboActivate and TurboFloat run natively on macOS (see requirements) and you can use it from any programming language. This article will show you some tips and tricks specific to macOS. You should use this article alongside one of the following:

Before you can do anything, you need to login to your LimeLM account (or sign up) and download the TurboActivate-Mac.zip. This zip contains the libTurboActivate.dylib along with source code examples.

"TurboActivate.dat" location

TurboActivate loads the "TurboActivate.dat" file from the same directory as the executable. If you want to load the "TurboActivate.dat" file from a directory other than the one the executable's path, then use the TA_PDetsFromPath() function.

Adding "libTurboActivate.dylib" to your application bundle

If you're making a C, C++, or Objective-C app (and you're not using the static library version of TurboActivate) then you need to make sure your application can find the "libTurboActivate.dylib" file at runtime. In Xcode you can do this by setting the "Runpath Search Paths" project setting:

Set the 'Runpath Search Paths' in Xcode

Use the "@executable_path" variable to load "libTurboActivate.dylib" relative to your app's binary. For instance, if "libTurboActivate.dylib" will be in the same path as your binary then you should set "Runpath Search Paths" to the following:

@executable_path/.

If you want "libTurboActivate.dylib" to be in the "Frameworks" directory of your app bundle, then you can set "Runpath Search Paths" to:

@executable_path/../Frameworks

Other commandline compilers

If you're building your app from commandline use the -rpath linker option. For instance, if you want to load libTurboActivate.dylib from your app's executable path, then the compiler options will look something like the following:

cc -o main ... -Wl,-rpath,@executable_path/.

If you want the *.dylib to be in the "Frameworks" directory in your *.app bundle, then the compiler options will look something like this:

cc -o main ... -Wl,-rpath,@executable_path/../Frameworks

Getting the version number of libTurboActivate.dylib

The version number is embedded in the *.dylib file. You can get it in human readable form by typing the following line in Terminal:

otool -L libTurboActivate.dylib

The output will be several lines long. The version number is on the second line before the closing parentheses. For example:

libTurboActivate.dylib:
    @rpath/libTurboActivate.dylib (compatibility version 1.0.0, current version 4.0.5)
    ...

Extra frameworks needed to use the static TurboActivateUsing the static library (libTurboActivate.a)

If you're using C, C++, or Objective-C then you also have the option of using the static library version of TurboActivate. In addition to including libTurboActivate.a in your project you also need to add references to the following Frameworks and libraries:

You can do this in XCode by setting the "Other Linker Flags" for the target as the following:

-lc++ -lcurl -framework CoreFoundation -framework CoreServices -framework Foundation -framework IOKit -framework SystemConfiguration