Welcome Guest,Register Now
Log In

ANT Forum

Welcome guest, please Login or Register

   

dynamic library linking in mac demo

Rank

Total Posts: 17

Joined 2011-01-24

PM

I'm running the demo with the dynamic library on mac. I'd like to be able to package the libant.dylib with the demo executable but it seems that I need to put libant.dylib in /usr/local/lib/ for demo_dylib to find it. What settings in the Xcode project do I need to change to make the dynamic library loader look in the same folder that demo_dylib is in?

Thanks,
Reid      
Avatar
RankRankRankRank

Total Posts: 662

Joined 2012-10-09

PM

We do not have much experience with distributing Mac applications, but you may find some useful information for settings for the dynamic linking here
http://developer.apple.com/library/mac/#documentation/Darwin/Reference/ManPages/man1/dyld.1.html

http://stackoverflow.com/questions/194485/how-do-i-create-a-dynamic-library-dylib-with-xcode      
Avatar
Rank

Total Posts: 3

Joined 0

PM

Hello Reid,

Have you found a solution???

I'm developing also on xcode..

thanks

Éric      
Rank

Total Posts: 17

Joined 2011-01-24

PM

Yes. I had to set the rpath on the dylib and the loader path on the executable. I ended up putting the dylib in a Library folder and referenced it in the loader path with a relative reference      
Avatar
Rank

Total Posts: 3

Joined 0

PM

Are you using xcode 4? I can't compile the demo project with it!      
Rank

Total Posts: 17

Joined 2011-01-24

PM

Yes. I had to add a void pointer cast. I'll post it when I get back to my pc      
Rank

Total Posts: 17

Joined 2011-01-24

PM

in dsi_timer.hpp, I had to change line 48 to this:
DSITimer(DSI_THREAD_RETURN (*fnTimerFunc_)(void *) = (void*(*)(void*))NULL, void *pvTimerFuncParameter_ = NULL, ULONG ulInterval_ = 0, BOOL bRecurring_ = FALSE);

for libant, I set Dynamic Library Installation Name to @rpath/libant.dylib.
for the demo dll executable, I set the run path search path to @loader_path/../Library
Then I put the library in that location relative to the executable.      
Avatar
Rank

Total Posts: 3

Joined 0

PM

Any chance you can send me your demo project... still no luck to find where it block!!!
ericboily<at>me.com

thanks