0

I develop a project on XCode, in which I have added somme dylib. The project compiles, and execute nicely when launched with XCode.

But when I try to launch it in my shell, I got lib errors :

iMac-de-Remi-Doolaeghe:MacOS remidoolaeghe$ ./Adobe\ InDesign\ CS5 
2011-12-16 10:08:55.160 Adobe InDesign CS5[8071:903] Error loading /Applications/Adobe InDesign CS5/Plug-Ins/Autocat/Autocat.InDesignPlugin/Autocat:  dlopen(/Applications/Adobe InDesign CS5/Plug-Ins/Autocat/Autocat.InDesignPlugin/Autocat, 265): Library not loaded: libboost_filesystem-xgcc42-mt-1_37.dylib
  Referenced from: /Applications/Adobe InDesign CS5/Plug-Ins/Autocat/Autocat.InDesignPlugin/Autocat
  Reason: image not found
2011-12-16 10:08:55.161 Adobe InDesign CS5[8071:903] Error loading /Applications/Adobe InDesign CS5/Plug-Ins/Autocat/AutocatUI.InDesignPlugin/AutocatUI:  dlopen(/Applications/Adobe InDesign CS5/Plug-Ins/Autocat/AutocatUI.InDesignPlugin/AutocatUI, 265): Library not loaded: libboost_filesystem-xgcc42-mt-1_37.dylib
  Referenced from: /Applications/Adobe InDesign CS5/Plug-Ins/Autocat/AutocatUI.InDesignPlugin/AutocatUI
  Reason: image not found
Bus error

That's an error I could workaround by copying the libs in my usr/lib folder. That's ok on my post. But that won't be ok when distributing it. I think I did something wrong with my linker in my XCode project, but can't see what.

I use XCode 3.2.6. The libs are presents in my targets, under "Link Binary With Libraries", and in "Libraries" folder under Groups&Files

I'm not sure if it matters, but my project is a plugin for Adobe InDesign.

Thanks in advance.

Rémi Doolaeghe
  • 2,262
  • 3
  • 31
  • 50

1 Answers1

0

I'm speaking under correction, but if it is a dynamic lib, you would have to have that dynamic lib on the machine where it gets distributed to as well. You might be interested in packaging the dynamic lib into your installation wizard or something.

However if it was a static lib, you could have enforced to include all symbols by using one of the following flags:

-Obj-C
-all_load
-force_load

A nice explanation on what these flags do and how to use them can be found here: Objective-C categories in static library

Community
  • 1
  • 1
Christo Smal
  • 615
  • 5
  • 16