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

前端 未结 25 1041
一生所求
一生所求 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条回答
  • 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.

    0 讨论(0)
  • 2020-11-28 04:53

    I got the same issues while making a build of Ionic 1 project.

    I was able to solve the issue after deleting the file CDVLogger.h & CDVLogger.m

    0 讨论(0)
  • 2020-11-28 04:56

    I just had to do import Foundation!

    I was using Kitura for Swift server side and kept forgetting this!

    0 讨论(0)
  • 2020-11-28 04:57

    The other answers didn't work for me so here I share my solution in case it might help somebody else:

    My problem was that I was configuring the Podfile of my XCode-Project for the wrong platform. Changing "platform :ios" at the beginning of my Podfile to "platform :macos" worked for me to get rid of the error.

    0 讨论(0)
  • 2020-11-28 04:58

    Maybe you installed a pod file and you are still trying to build from the .xcodeproj file instead of .xcworkspace

    0 讨论(0)
  • 2020-11-28 05:00

    Did not have this problem when I built and ran on my own device. Only had this problem with simulators. I just simply restarted my computer and ran it. It worked.

    0 讨论(0)
提交回复
热议问题