MacOS上的Qbs StaticLibrary

时间:2017-11-26 12:15:15

标签: c++ macos qt static-libraries qbs

我尝试将现有项目从qmake移动到qbs,到目前为止一切正常但我无法链接到MacOS上该项目中的谷歌测试静态库,而在Windows上工作正常。

在MacOS上,我得到:-1: error: symbol(s) not found for architecture x86_64

GitHub repo of the project

googletest.qbs:

import qbs

StaticLibrary {
    name: "GoogleTest"
    files: [
        "googletest/googletest/src/gtest-all.cc",
        "googletest/googlemock/src/gmock-all.cc"
    ]

    cpp.includePaths: [
        "googletest/googletest/include",
        "googletest/googlemock/include",
        "googletest/googletest",
        "googletest/googlemock"
    ]

    Depends { name: "cpp" }
    Export {
        Depends { name: "cpp" }
        cpp.includePaths: [
            "googletest/googletest/include",
            "googletest/googlemock/include"
        ]
    }
}

test.qbs:

import qbs

QtApplication {
    name: "Test"
    targetName: "Test"

    Depends { name: "Qt"; submodules: ["core","testlib"]; versionAtLeast: "5.6" }
    Depends { name: "GoogleTest"}

    cpp.cxxLanguageVersion: "c++11"
    consoleApplication: true

    files: [
        "QtTypePrinters.h",
        "main.cpp",
        "QStringTest.cpp"
    ]
}

1 个答案:

答案 0 :(得分:0)

您确定来自链接器的整个错误消息吗?当然还提到了实际遗漏的符号?