Create an account

Very important

  • To access the important data of the forums, you must be active in each forum and especially in the leaks and database leaks section, send data and after sending the data and activity, data and important content will be opened and visible for you.
  • You will only see chat messages from people who are at or below your level.
  • More than 500,000 database leaks and millions of account leaks are waiting for you, so access and view with more activity.
  • Many important data are inactive and inaccessible for you, so open them with activity. (This will be done automatically)


Thread Rating:
  • 955 Vote(s) - 3.5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Duplicate symbols for architecture x86_64 under Xcode

#1
I now have the same question with above title but have not found the right answer yet. I got the error:

/Users/nle/Library/Developer/Xcode/DerivedData/TestMoboSDK-Client-cgodalyxmwqzynaxfbbewrooymnq/Build/Intermediates/TestMoboSDK-Client.build/Debug-iphonesimulator/TestMoboSDK-Client.build/Objects-normal/x86_64/MoboSDK.o
/Users/nle/Library/Developer/Xcode/DerivedData/TestMoboSDK-Client-cgodalyxmwqzynaxfbbewrooymnq/Build/Products/Debug-iphonesimulator/libMoboSDK.a(MoboSDK.o)
duplicate symbol _OBJC_METACLASS_$_MoboSDK in:
/Users/nle/Library/Developer/Xcode/DerivedData/TestMoboSDK-Client-cgodalyxmwqzynaxfbbewrooymnq/Build/Intermediates/TestMoboSDK-Client.build/Debug-iphonesimulator/TestMoboSDK-Client.build/Objects-normal/x86_64/MoboSDK.o
/Users/nle/Library/Developer/Xcode/DerivedData/TestMoboSDK-Client-cgodalyxmwqzynaxfbbewrooymnq/Build/Products/Debug-iphonesimulator/libMoboSDK.a(MoboSDK.o)
ld: 75 duplicate symbols for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Any help is appreciated.

**Finally** I find out the reason of this error cause I added `-ObjC` to the `Other Linker Flags`. After remove this value then I can build my project successfully, but I don't know why. Can anyone explain this?
Reply

#2
Stupid one, but make sure you haven't `#import`ed a `.m` file by mistake somewhere
Reply

#3
I found the accepted answer touches on the problem but didn't help me solve it, hopefully this answer will help with this very frustrating issue.

duplicate symbol _OBJC_IVAR_$_BLoginViewController._hud in:

17 duplicate symbols for architecture x86_64

*"Means that you have loaded same functions twice. As the issue disappear after removing -ObjC from Other Linker Flags, this means that this option result that functions loads twice:"*

In layman's terms this means we have two files in our project with exactly the same name. Maybe you are combining one project into another one? Have a look at the errors above the "duplicate symbols" error to see which folder is duplicated, in my case it was BLoginViewController.

For example, in the image below you can see I have two BImageViewControllers, for me this is what was causing the issue.

As soon as I deleted one then the issue vanished :)

![enter image description here][1]






[1]:
Reply

#4

Remove -ObjC from Other Linker Flags or
Please check you imported any .m file instead of .h by mistake.
Reply

#5
Happens also when you declare const variables with same name in different class:

in file Message.m

const int kMessageLength = 36;

@implementation Message

@end

in file Chat.m

const int kMessageLength = 20;

@implementation Chat

@end
Reply

#6
Same issue happen with me, when I was integrating the lob project inside my project.

![enter image description here][1]


Actually lob project also have the AFNetworking files,
So I remove the .m files from lob project.

![enter image description here][2]

Actually .m files are conflicting with My project POd/AFNetworking/ .m files

![enter image description here][3]


[1]:

[2]:

[3]:
Reply

#7
Following steps solved the issue for me.

1. Go to Build Phases in Target settings.
2. Go to “Link Binary With Libraries”.
3. Check if any of the libraries exist twice.
4. Build again.

Reply

#8
In Xcode 6.3.2. I have checked all possibility like as belowed

1: I have not import .m file in my project.

2: Removed `-ObjC` from **Other linker flag**.

3: Removed all my **derive Data**.

still i am getting same error. **I have removed this error by removing any variable declaration from `.pch` file**. in my case, i have declared `AppDelegate` object in `.pch` file. finally i found reason that cause error. so i remove declaration of any variable from .pch file and my project working charm.
Reply

#9
Recently had a headache looking for source of an error. I was wondered, when i found out that my app doesn't want to compile, simply because i had following code snippet in different classes:

dispatch_time_t getDispatchTimeByDate(NSDate *date)
{
NSTimeInterval interval;
double second, subsecond;
struct timespec time;
dispatch_time_t milestone;


interval = [date timeIntervalSince1970];
subsecond = modf(interval, &second);
time.tv_sec = second;
time.tv_nsec = subsecond * NSEC_PER_SEC;
milestone = dispatch_walltime(&time, 0);

return milestone;
}

Hope that might help someone.
Reply

#10
For me, changing 'No Common Blocks' from Yes to No ( under Targets->Build Settings->Apple LLVM - Code Generation ) fixed the problem.
Reply



Forum Jump:


Users browsing this thread:
2 Guest(s)

©0Day  2016 - 2023 | All Rights Reserved.  Made with    for the community. Connected through