c++ - Creating library on Mac OS X -
i trying create dynamic library on mac os x. use qmake generate makefile platform. dylib builds fine, creates version-specific name , 3 symlinks different version specifiers:
- libsimplezip.1.0.0.dylib
- @libsimplezip.1.0.dylib --> libsimplezip.1.0.dylib
- @libsimplezip.1.dylib --> libsimplezip.1.0.0.dylib
- @libsimplezip.dylib --> libsimplezip.1.0.0.dylib
this default behavior , would, maybe, not care, problem appears when try using library in project:
libs += -lpath/to/lib -lsimplezip
thus xcode links library libsimplezip.dylib, in order run program, dynamic library has placed inside bundle. in order achieve use copy files build phase. unfortunately, doesn't work, because xcode resolves symlink , copies file giving same name symlink, i.e. libsimplezip.dylib, while library's install name libsimplezip.1.dylib. consequently program unable find library.
so how supposed done? should change install name of library libsimplezip.dylib, doesn't have version specifier? or should specify library version like
libs += -lpath/to/lib/libsimplezip.1.dylib
or maybe should somehow disable version specifiers? common way?
Comments
Post a Comment