tags:

views:

47

answers:

2

Hey, guys! I want to wrap the vlc, importing the vlc dylibs. But this simple iPhone App call those third-party dylibs failed at the beginning of loading without any prompts. I even try to make a 'hello world' xcode project, just add libvlc.2.dylib & libvlccore.0.dylib but not calling, without any 1 more code manually. After download it to the iPhone device(3.1.3), it splash and exit immediately, no info throw out. BTW, all the dylibs imported were put to the right dirs. It really make me confused! Could any body show me the solution, appreciated!

run otool on device:

root# otool -L test1 test1: /System/Library/Frameworks/Foundation.framework/Foundation (compatibility version 300.0.0, current version 678.51.0) /System/Library/Frameworks/UIKit.framework/UIKit (compatibility version 1.0.0, current version 1000.0.0) /System/Library/Frameworks/CoreGraphics.framework/CoreGraphics (compatibility version 64.0.0, current version 359.16.0) /System/Library/Frameworks/CoreData.framework/CoreData (compatibility version 1.0.0, current version 248.0.0) @executable_path/PlugIns/libvlccore.0.dylib (compatibility version 1.0.0, current version 1.2.0) @executable_path/PlugIns/libvlc.2.dylib (compatibility version 3.0.0, current version 3.2.0) @executable_path/PlugIns/liblive555_plugin.dylib (compatibility version 0.0.0, current version 0.0.0) /usr/lib/libgcc_s.1.dylib (compatibility version 1.0.0, current version 1.0.0) /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 111.2.1) /usr/lib/libobjc.A.dylib (compatibility version 1.0.0, current version 227.0.0) /System/Library/Frameworks/CoreFoundation.framework/CoreFoundation (compatibility version 150.0.0, current version 478.52.0)

+1  A: 

iPhone apps cannot link to any additional libraries except those that are on the iPhone already. You need to compile any external libraries into your binary (as a static library).

Michal
-1. I've just managed to get this working on both 3.1 and 4.1.
tc.
Oops, my bad. Looks like it works when you run it from Xcode, but not from SpringBoard (arrrrrrrrgh).
tc.
Hm. Works if you additionally codesign the .dylib (launching from Xcode appears to skip some code-signing checks)
tc.
A: 

thoes librarys are already on the on the iPhone, after installing the vlc4iphone from cydia. I just want to wrapper those libs, but failed.

You might want to get accustomed with stackoverflow a bit. You should write this as a comment on my answer, not as an answer - it is none.
Michal
Anyway. I'm not familiar with cydia nor vlc4iphone, but if cydia's vlc4iphone is bundled the same way as official applications are, then those vlc libraries are not on the library path for your application - because they're not installed for the whole system, but are just inside the vlc4iphone bundle.
Michal