Linker Command failed with exit code 1 (use -v to see invocation), Xcode 8, Swift 3

前端 未结 25 1290
一生所求
一生所求 2020-11-28 04:28

I can\'t get rid of this error!

I have tried all sorts of things like clearing Derived Data(Preferences->Locations->click gray arrow to open Derived Data fo

25条回答
  •  旧时难觅i
    2020-11-28 04:52

    Ok, I had the same problem just today and started googling it, when I came across this thread. I haven't finished reading the question when the answer struck my mind: I declared a class with an empty constructor

    class MyClass{
        MyClass();
    
        void func_one(){
        // code
        }
    
        void func_two(){
        // code
        }
    
        ~MyClass(){
            cout << "Deleting object" << endl;
         }
    };
    

    Then I thought why not terminating (not sure if I'm correct with word selection here, but who cares) the constructor of my class with curly braces ({}). So I did:

    class MyClass{
        MyClass(){}
    
        void func_one(){
        // code
        }
    
        void func_two(){
        // code
        }
    
        ~MyClass(){
            cout << "Deleting object" << endl;
         }
    };
    

    The problem eliminated, my code started working perfectly.

    I know, the good practice is to investigate the issue and find the real cause, but this worked for me.

提交回复
热议问题