Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

ld: symbol(s) not found for architecture x86_64



  • Undefined symbols for architecture x86_64:
    "ObjectiveActivity::setConfigSetting(QString)", referenced from:
    SystemManager::setConfigSetting(QString) in libOOP.a(systemmanager.o)

    //*********************************************************************** objectiveactivity.h
    #ifndef OBJECTIVEACTIVITY_H
    #define OBJECTIVEACTIVITY_H
    #include <QString>
    class ObjectiveActivity
    {
    public:
    ObjectiveActivity();
    static QString setConfigSetting(QString value);
    };
    #endif

    //************************************************************************ objectiveactivity.mm
    #include "objectiveactivity.h"
    #import <Foundation/Foundation.h>
    //#include <CoreFoundation/CoreFoundation.h>
    ObjectiveActivity::ObjectiveActivity (){}
    QString ObjectiveActivity::setConfigSetting(QString value){
    NSLog(@"Value of string is %@", value.data());
    return "Good night, Gracie!";
    }

    //**************************************************************************************************** some of my Setting .pro
    QT += sql core gui quick concurrent
    CONFIG += c++11
    DEFINES += QT_DEPRECATED_WARNINGS

    ios: {
    HEADERS +=../IOs/objectiveactivity.h
    OBJECTIVE_SOURCES +=
    ../IOs/objectiveactivity.mm
    OTHER_FILES +=
    ../IOs/objectiveactivity.mm
    QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.13
    }


  • Lifetime Qt Champion

    Hi,

    Are you building for iOS ?



  • Yes, it's for iOS
    I find the solution

    ios: {
    HEADERS +=../IOs/objectiveactivity.h\

    OBJECTIVE_SOURCES +=\
    ../IOs/objectiveactivity.mm
    
    OTHER_FILES += \
    ../IOs/objectiveactivity.mm
    

    }
    //*******************************************objectiveactivity.h
    #pragma once
    #include <QObject>
    #include <QString>
    class ObjectiveActivity : public QObject{
    Q_OBJECT
    public:
    ObjectiveActivity();
    static QString setConfigSetting(QString value);
    };
    //*******************************************objectiveactivity.mm
    #import "objectiveactivity.h"
    #import <Foundation/Foundation.h>
    ObjectiveActivity::ObjectiveActivity (){}
    QString ObjectiveActivity::setConfigSetting(QString value){
    NSLog(@"Value of string is %@", value.toNSString());
    return "Good night, Gracie!";
    }


Log in to reply