[QBS] Dynamic library not loaded

Dmitry Volosnykh dmitry.volosnykh at gmail.com
Sun Dec 6 17:21:14 CET 2015


I've merely missed  Depends { name: "cpp" } item inside DynamicLibrary. So
now I have project successfully compiled. But it does not run failing with
the following error:

dyld: Library not loaded: library.framework/Versions/A/library
Referenced from:
/Users/dvolosnykh/Development/hobby/qt/build-test-Desktop_Qt_5_5_1_clang_64bit-Debug/qtc_Desktop__e049b762-debug/install-root/application

Reason: no suitable image found. Did find:
/Users/dvolosnykh/Development/hobby/qt/build-test-Desktop_Qt_5_5_1_clang_64bit-Debug/qtc_Desktop__e049b762-debug/install-root/Library/Frameworks/library.framework/Versions/A/library:
stat() failed with errno=20
The program has unexpectedly finished.

When I add disable bundling for library.qbs

Depends { name: "bundle" }
bundle.isBundle: false

it works as expected. But I really cannot figure out how to deploy bundles
properly.

On Sat, Dec 5, 2015 at 10:21 PM Dmitry Volosnykh <dmitry.volosnykh at gmail.com>
wrote:

> I am trying to setup project with application and a dynamic library. But
> linker fails with the following error:
>
>
> Undefined symbols for architecture x86_64:
> "Greeter::sayHello() const", referenced from:
> _main in main.cpp.o
> ld: symbol(s) not found for architecture x86_64
> clang: error: linker command failed with exit code 1 (use -v to see
> invocation)
>
> Here is project setup:
>
> --- test.qbs ---
> import qbs
>
> Project {
> minimumQbsVersion: 1.4
>
> references: [
> "application/application.qbs",
> "library/library.qbs"
> ]
> }
>
> --- library.qbs ---
> import qbs
>
> DynamicLibrary {
> files: ["lib.h", "lib.cpp"]
>
> Export {
> Depends { name: "cpp" }
> cpp.includePaths: product.sourceDirectory
> }
> }
>
> --- applicaiton.qbs ---
> import qbs
>
> CppApplication {
> Depends { name: "library" }
> consoleApplication: true
> files: "main.cpp"
> }
>
>
>
> Environment: Mac OS X 10.11.1
> Qt 5.5.1
>
> I am totally missing something.
>
> Regards,
> Dmitry.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/qbs/attachments/20151206/6b3d70ef/attachment.html>


More information about the Qbs mailing list