[QBS] Dynamic library not loaded

Dmitry Volosnykh dmitry.volosnykh at gmail.com
Sat Dec 5 20:21:56 CET 2015


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/20151205/187402cb/attachment.html>


More information about the Qbs mailing list