How can I create a single Const “path” to an external library? My problem is I need a const for the “pathtolib” to the library and I use it in a lot of places, cross platform, debug and production. Is there any way to make a single instance of this? I suppose I could put all the methods into a class and do it once there but the methods belong in other classes, imho…I’d love to hear how others might be approaching this.
#If TargetMacOS #If DebugBuild
Const pathtolib As String ="…/MyBridge.debug Libs/pluginDylib/slvsPlugin.dylib" #Else
Const pathtolib As String ="…/MyBridgeLibs/pluginDylib/slvsPlugin.dylib" #EndIf #Else #If DebugBuild
Const pathtolib As String =“DebugMyBridgeWin Libs/slvsPlugin.dll” #Else
Const pathtolib As String =“MyBridgeWin Libs/slvsPlugin.dll” #EndIf #EndIf
I did - and thats great, but this is inside another helper app so another level. How did you get it into a const? Like App.ExecuatbleFile.Name + “Libs” + “dllname.dll” How do you only need one with the debug app name changing?
My helper app is packaged in Helpers on macOS, which allows Frameworks to still be in the correct location. The Windows helper includes the Libs folder. The constant is defined like this:
Wait a sec, I am not able to get a Win version of @executable_path, so how can I change from debug to production on win or lin? Why does the path need to be a const anyway?