GCC-4.2 Failed With Error Code 1 - iphone

I am receiving the following error out of the blue after trying to build my iPhone Application onto my iPod Touch:
Command /Xcode3/Platforms/iPhoneSimulator.platform/Developer/usr/bin/gcc-4.2 failed with exit code 1
I am also receiving the following warnings which I presume have something to do with this error, maybe a possible cause:
ld: warning: in /Users/Max/git/iTopCharts/iTopCharts/Classes/NSAdditions/libNSAdditions_Device.a, missing required architecture i386 in file
ld: warning: in /Xcode3/Platforms/iPhoneOS.platform/DeviceSupport/4.2.1 (8C148)/Symbols/usr/lib/libSystem.dylib, missing required architecture i386 in file
ld: in /Xcode3/Platforms/iPhoneOS.platform/DeviceSupport/4.2.1 (8C148)/Symbols/usr/lib/libobjc.A.dylib, missing required architecture i386 in file
All help with this is extremely appreciated, as I have spent days making this application.

This error is caused by many different problems.
Sometimes it gets called, when some file has been deleted, but its reference is still in the Xcode.
OR
It might occurs, if you have copy-pasted data from some other project. In some cases, Xcode keeps the reference with it. (If this is the case, then you need to trace that variable, and rename it)
If none of above meets your case, then you need to look at the error in more details. For this,
In xcode, right click the error line and choose "Open These Latest Results as Transcript Text File". This will open the real xcode output log, which should contain a better description of the error then was previously seen.
EDIT:Be sure to search 'exit code 1' and the description will be right above the results.
I hope it helps

Related

Strange compiler warning when precompiling prefix.pch

When I want to start my app, I get this:
clang: error: invalid version number in '-mios-simulator-version-min= '
Command /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang failed with exit code 1
What's going on? When I google this error, I'm getting ZERO. This seems to be a very strange failure.
Please apologize, that I can't give more information. It's because I'm completely clueless.
Help!
OK, I've found the solution:
.xcodeproj > General > Deployment Target ----> was empty!
This is not allowed.
Try cleaning your project and/or quitting and relaunching Xcode. I've had various odd problems with Xcode that require one or the other of those things.
In my case there is a space after 8.0 like "8.0 ". When I remove space and re-build error disappears.

xCode iOS Dev - Apple Mach-O Linker Error // Dsymutil Error

I'm in SERIOUS need of help. I have had 3 unsuccessful evenings of unproductive coding. Please someone, figure this error out & make me feel stupid for overlooking something so simple. :)
[ISSUE #1]
I keep getting the "Apple Mach-O Linker Error"
Linker command failed with exit code 1 (use -v to see invocation)
[ISSUE #2]
Also... I keep getting the "Dsymutil Error"
error: unable to open executable '/Users/PsychodelicFuzz/Library/Developer/Xcode/DerivedData/CHH-bmbqxvfwddzaupfaavvipxaqwvfx/Build/Products/Debug-iphonesimulator/CHH.app/CHH'
Thanks to anyone willing to lend a helping hand <3
Change Debug Information Format from build setting to "DWARF"
These are likely related. dsymutil is getting an error because your executable binary CHH.app doesn't exist. It doesn't exist because ld failed.
Open the Log Navigator pane in Xcode, click on your build entry in that pane after the build has failed, then if you hover over the right-hand side of the line for "Link ... CHH.app" you'll see a disclosure icon - hit that and you will see the actual ld invocation and the actual error message that it printed. With luck that will get you pointed in the right direction.

ld: 871 duplicate symbols for architecture armv7, clang: error: linker command failed with exit code 1 (use -v to see invocation)

I am using FastPDFKit in my iPhone app for displaying PDF. When I run the project on simulator, it works fine. However when I run the project on iPhone, it gives me below error.
duplicate symbol _value_map in:
/Users/alkandari/Desktop/iPhone Apps/MyTest002/MyTest002/FastPdfKit.embeddedframework/FastPdfKit.framework/FastPdfKit(FastPdfKit)
duplicate symbol _writeUnicodeToUTF8Buffer in:
/Users/alkandari/Desktop/iPhone Apps/MyTest002/MyTest002/FastPdfKit.embeddedframework/FastPdfKit.framework/FastPdfKit(FastPdfKit)
ld: 871 duplicate symbols for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)
ld: 871 duplicate symbols for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Any idea why it is happening like this?
Error comes when I add FastPDFFramework in Configuration in Debug and Release section.
Here's a solution I found even after messing with the header/framework search paths, rebuilding, etc:
http://support.fastpdfkit.com/discussions/problems/443-i-am-unable-to-link-fastpdfkitembeddedframework
I removed the -all_load linker flag in my project and it compiled successfully. As a warning, make sure removing this flag is appropriate for your project. It was probably placed there for a reason
Can you try to clean up the FastPdfKit target and recompile it? It should generate a new framework ex-novo that you then should be able to add to you project, overwriting the one you are using. You can grab the new .embeddedframework in the FastPdfKit project root directory.
These line helped me from the link below.
http://support.fastpdfkit.com/discussions/problems/759-duplicate-symbols-for-architecture-armv7
there are another reason this error often happens is accidentally importing the .m file instead of the .h.
it's happened to me :)
link : https://stackoverflow.com/questions/12279622/duplicate-symbols-for-architecture-i386-clang
You have too many #include or #import directives in header files for the same things. Move to using #class in headers and only import/include in your .m files.
In all you just need to review where these are and reassess them.
I add my solution, as if you follow the readme, it will ask you to do:
Inherit the project options: select the Project an from info tab and configurations line choose **FastPdfKitFramework** from the drop down list;
I replace the FastPdfKitFramework target to None and now it work great.
As it is on the readme file, I never add .a in my project so download the recompile one don't help me as I do not want to restart all integration.
I hope it can be helpful for someone.
I tries removing -all_loads linker flag, and it worked for me without any problem in the project.

clang: error: -Z-reserved-lib-stdc++

I am migrating from 4.3 to xCode preview45
While linking my coreplot lib, i am getting this, which i am trying to resolve since last 5 days.
Please suggest me what should i do to overcome this issue. clang:
clang: error: -Z-reserved-lib-stdc++: 'linker' input unused when '-c' is present
Command /Volumes/Xcode 1/Xcode45-DP3.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang failed with exit code 1
I tried changing C/C++ compiler,linker flag, etc, nothing worked so far.
Thanks
The easiest way to fix this is to pull the latest code with Mercurial. If you don't want to do that, you need to remove several compiler flags and make some other changes. See the necessary changes here and here.

Error while linking an app

getting this error while linking an app, some one an idea?
ld: duplicate symbol _OBJC_METACLASS_$_FBCustomLoginDialog1 in ....
Command
/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/clang
failed with exit code 1
As i know i linking a file twice... budet how to fix it?
The same .m file is likely included in your project twice. See this thread for suggestions on how this could have happened.