Xcode compiler C Language program error: ld:x duplicate symbol for Architecture x86_64 Clang:error:linker command failed with exit code 1 (use- V to see invocation)

Source: Internet
Author: User
Tags null null object model

Check it out online:

The general meaning of duplicate symbol is that the compiler thinks you have defined something repeatedly.

Linker command failed with exit code 1, it is possible that the project introduced multiple identical files.

In combination with my development found this type of problem, the solution is as follows:

Method 1: See if the file in question has a duplicate reference. Or if the header file is loaded. m

Method 2: Remove the problematic file and reload it. Then: Clean->build.

A similar approach to solving regexkitllite in development:

_rkl_nsexceptionforregex in REGEXKITLITE.O "_u_strlen", referenced from:_rkl_userinfodictionary in REGEXKITLITE.O "_ Uregex_clone ", referenced From:-[rklblockenumerationhelper initwithregex:options:string:range:error:]in RegexKitLite.old:symbol (s) not found for architecture I386collect2:ld returned 1 exit status

Workaround:

Find the other Linker Flags in the project's compilation settings, then double-click in the fields below, and add "-licucore" to OK.

Summary of common problems in development:

The content is for personal study use, there are shortcomings please make bricks.

Create a window with code, no response, cannot enter the Didfinishlaunchingwithoptions method.

Error Description: Use code to create a window, no response, unable to enter the Didfinishlaunchingwithoptions method.

Error reason: Did not correctly rewrite the Didfinishlaunchingwithoptions method, or modify the wrong write method did not find

Solution: Correctly override the Didfinishlaunchingwithoptions method

Reason: ' couldn ' t find a common superview for ... Uilabel:0x7f8ec05c3ab0 frame = (0 0; 0 0);

Error reason couldn ' t find a common superview for ... frame = (0 0; 0 0); The object was not added to the parent control before using masonry

Solution: Add objects to a control before masonry control object constraints

[Self.viewaddSubview:label];


Duplicate declaration of Method Error Reason: Declaration of a copy method (duplicate definition, duplicate declaration)

Duplicate symbols for architecture error Reason: Duplicate import. m file or error import. m file

Solution: Delete the same declaration, define

Application windows is expected to has a root view controller at the end of application launch '

Cause of error: The root controller of the window is not set

Solution: self.window.rootviewcontroller= vc;//Setting up the root controller

Could not find a storyboard named ' main ' in bundle NSBundle

Cause of Error: No storyboard named Main is found by default is Main.storyboard

Solution: Uistoryboard*storyboard = [uistoryboardstoryboardwithname:@ "main" bundle:nil];m changed to uppercase

Cuicatalog:invalid Asset name supplied: (NULL)

Cause of error: incompatible pointer types sending ' UIImage * ' to parameter of type ' NSString * _nonnull '

Model type does not match the view when you use the model to set data

Solution: Check the model type so that it is consistent when used in the View object.

Error description: Static table views is only valid when embedded in Uitableviewcontroller instances

Error reason: A static cell with Talbe view is used incorrectly, and a static cell can only be used in an instance object of Uitableviewcontroller

Solution: Using dynamic cell, select dynamic prototypes in the property content of Table view

Configurecellfordisplay:forindexpath not bound identifier

Error description:-[uitableview _configurecellfordisplay:forindexpath:]

Terminating app due to uncaught exception ' nsinternalinconsistencyexception ', Reason: ' UITableView behind a bunch of uitableview properties

Error reason: No assignment, bind the ID of the object cell in the Cellforrowatindexpath method, causing the object to not be created

Solution: Assign, Tableviewcell attribute ID in the binding storyboard with the same creation Cellid

[Constraint warning] Unable to simultaneously satisfy constraints. There may be duplicate constraints

Cause: The system automatically determines that there may be duplicate constraints in the code and the editor, which may cause errors

Probably at least one of the constraints in the following list are one you don ' t want.

Try this:

(1) Look at each constraint and try to figure out which you don ' t expect;

(2) Find the code that added the unwanted constraint or constraints and fix it.

(

Solution: Modify the precedence of an object constraint

Setvalue:forundefinedkey:]:this class is isn't key value coding-compliant for the key xxxx

Cause: The properties of the model and the plist file do not match

Root cause: Attribute missing error key after XX//find attribute, data type, basic data type is not more *

1. plist data and model properties with the same name cannot be found

Correct: Modify the name of the plist or model to remain consistent

2. The model is not a pointer-type write * number

Correct: Modify the type of the model or remove the * number

Reason: Xib file does not select (link) View name causes the model to assign values to the view e.g.shopview.shop= shop;

Solution: Modify Xib's Custom Class


Error description: Failed to instantiate the default view controller for Uimainstoryboardfile ' Main '-perhaps the designated entry Poin T is not set?

Cause of error: No arrow pointing to the controller is inital View controllers

Solution: Properties Page view Controller settings is inital view Controller Yes

Variable conflict Copywithzone Unrecognized selector sent to instance

Error description:-[uilabel copywithzone:]: Unrecognized selector sent to instance 0x7fff21746b20

Error Reason: attribute and variable name conflict

Solution: Modify a property or variable name

Bad pointers when using proxy methods exc_bad_access

Error Description:

Error reason: Write wrong to let the agent execute proxy method before the judgment statement, written as the execution statement.

if ([Self.delegateperformselector: @selector (Addvc:andadditem:)]) {

Gladditem*additem = [GLaddItemaddItemWithName:self.nameTextF.textandNum:self.tellTextF.text];

[Self.delegateaddVC:selfandAdditem:additem];

[Self.navigationControllerpopViewControllerAnimated:YES];

}

Solution: Change the Performselector method to Respondstoselector

if ([Self.delegaterespondstoselector: @selector (Addvc:andadditem:)]) {

Gladditem*additem = [GLaddItemaddItemWithName:self.nameTextF.textandNum:self.tellTextF.text];

[Self.delegateaddVC:selfandAdditem:additem];

[Self.navigationControllerpopViewControllerAnimated:YES];

}

Bad pointer exc_bad_access Conflicting return type in implementation of ' AddItem ': ' Data type X ' vs ' return value '

Error description: Conflicting return type in implementation of ' AddItem ': ' Gladditem * ' vs ' void '

runtime, when accessing a variable, causes a bad pointer

Reason for error: Duplicate method name and variable name defined

Resolution: Modify the method name or variable name

Loaded the ' xxx ' view outlet is not set

Error description '-[uiviewcontroller _loadviewfromnibnamed:bundle:] Loaded the "Gleditcontroller" nib but the view outlet is not set. '

Cause of error: The controller described by Xib does not have a continuous view

Solution: Connect owner's view in Xib

Incompatible pointer to integer conversion assigning to ' Uitableviewcellseparatorstyle ' (aka ' enum Uitableviewcellseparatorstyle ') from ' uiswitch * '

Prompt assignment is incorrect, object should be an enumeration value

Isequaltostring,length model classes, model objects use confusion

-[glwine isequaltostring:]

-[glwine length]: Unrecognized selector sent to instance

Cause of Error: Assignment of an incorrect object model array inside is a model class object, not a model object

Workaround: First create the Model class object and then use the Model object

Glwine*wine =self.wines[indexpath.row];

cell.imageview.image= [UIImageimageNamed:wine.image];

Dictionary to model no value, error [__nscfstring objectforkeyedsubscript:] [__nscfdictionary length]

No value:

1. Controller override model array The Get method first does not initialize the array

_wines= [Nsmutablearrayarray]; the added object is null null without initialization

2[__nscfstring Objectforkeyedsubscript:]: Unrecognized selector sent to instance

[__nscfdictionary length]: Unrecognized selector sent to instance

Incompatible pointer types assigning to ' NSString * ' from ' nsdictionary * '

Error reason: Did not write the full dictionary, notice in the model object in the dictionary assignment dictionary to write the integrity, Forin is generally the traversal array,

Workaround: Check the dictionary write integrity and modify it according to the data source (plist or network)

Tip tip: If the dictionary dict[@ "Cars" Dictionary key input is incorrect, will only result in no data but will not error.

TableView proxy object has no implementation method

[Viewcontroller tableview:numberofrowsinsection:]: Unrecognized selector sent to instance

0. Proxy object does not declare the corresponding protocol

assigning to ' ID _nullable ' from incompatible type ' Viewcontroller *const __strong ' self.tableview.datasource=self; or drag the line to the controller (other proxy objects)

1. The proxy object does not implement the Protocol method that must be implemented 1

Method ' tableview:numberofrowsinsection: ' in protocol ' Uitableviewdatasource ' not implemented

2. The proxy object does not implement the Protocol method that must be implemented 2

Method ' tableview:numberofrowsinsection: ' in protocol ' Uitableviewdatasource ' not implemented-[viewcontroller Tableview:numberofrowsinsection:]

3. The proxy object does not implement the Protocol method that must be implemented 3Method ' Tableview:cellforrowatindexpath: ' declared here

-[uitableview _configurecellfordisplay:forindexpath:]

The workaround must implement:

-(Nsinteger) Numberofsectionsintableview: (uitableview*) tableview//not implemented return 1

-(Nsinteger) TableView: (uitableview*) TableView numberofrowsinsection: (nsinteger) Section

-(uitableviewcell*) TableView

Write Wrong punctuation

Error: expected ' or ', '

Reason: 1. The wrong solution for array connection symbols: required, comma link

2. The last element of the array wrote the connection symbol solution: Remove the connection symbol after the last element

3.Expected '; ' After expression shorthand array, and finally no semicolon solution: plus statement ending symbol;

Constraint error

Unable to simultaneously satisfy constraints.

Probably at least one of the constraints in the following list are one you don ' t want.

Try this:

(1) Look at each constraint and try to figure out which you don ' t expect;

(2) Find the code that added the unwanted constraint or constraints and fix it.

Constraints that cannot be met at the same time.

One of the constraints that may be at least in the following list is one that you do not want.

Try this: (1) look at each constraint and try to get it, you will not expect;

(2) Find the code that adds unnecessary constraints or restrictions and fix it.

Error reason 1://the bottom of a object equals B to the right, the corresponding connection cannot be found

Make.bottom.equalTo (Blueview.right);

Error reason 2://the same object repeatedly written with the same constraint

Make.top.equalTo (Blueview.top);

Make.top.equalTo (Blueview.bottom);

Could not load NIB on bundle with name XXX

Reason reason: ' Could not the load nib in bundle: ' NSBundle cannot find the nib to read

(loaded) ' with Name ' Glshopview '

Solution: Change the name of Xib to what view class name

Auto property synthesis won't synthesize property ' title '; It is implemented by its superclass, use @dynamic to acknowledge intention

Error reason: Automatic attribute composition does not synthesize attribute title; it will be executed by its superclass, using the acknowledgment intent @dynamic

Uilabel...title

Correction: Uilabel do not use title as the property identifier

No visible @interface for ' nsarray<__kindof UIView *> ' declares the selector ' Removelastobject '

Error reason: Nsarray is an immutable group cannot use to delete the last element

Solution: Use Nsmutablearray or [Self.shoptable.subviews.lastObjectremoveFromSuperview];

-[__nsarraym Objectatindex:]: Index 6 beyond bounds [0.. 5] '

-[__nsarraym Objectatindex:]: Index 6 beyond bounds [0:5] '-[__nsarraym Objectatindex:]: Index 6 beyond bounds [0:5] ‘

Index 0 beyond bounds for empty array

Error Reason: Array subscript is out of bounds

Solution: Print Check the number of arrays and modify as needed

Unrecognized selector sent to instance

Cause: A non-existent method was called and the method was deleted/commented/Name modified

Workaround: Carefully check the method name, use the correct and existing method name

Not key value for the key ... Redundant connections

Cause: The Iboutlet attribute code is deleted/commented, but the attribute line is still

Root cause: Attribute missing error key after XX//Find property

Solution: Remove the storyboard residue, or connect the line

Receiver type ' nstextalignment ' (aka ' enum Nstextalignment ') is a objective-c class

Cause of error: The Objective-c class Property return value is a enumeration, followed by a class call method

Solution: Write the enumeration values directly

Links: https://www.jianshu.com/p/12babc2cc406
Source: Pinterest

Xcode compiler C Language program error: ld:x duplicate symbol for Architecture x86_64 Clang:error:linker command failed with exit code 1 (use- V to see invocation)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.