문제

I'm getting the following error in Xcode 3.2.1 on Snow Leopard 10.6.2 whenever I try to compile any iPhone application generated by Appcelerator Titanium. However, the build error only appears when I select iPhone simulator on the architecture menu and if I select the iPhone device, I am able to run the app on my device .

Further more, the iPhone simulator launches successfully and executes the program directly from the Titanium environment which uses Xcode to build .

Why is this happening ?

ld: duplicate symbol _main in Resources/libTitanium.a(main.o) and /Users/prithviraj/Documents/project/Final/build/iphone/build/Final.build/Debug-iphonesimulator/Final.build/Objects-normal/i386/main.o collect2: ld returned 1 exit status Command /Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/gcc-4.2 failed with exit code 1

도움이 되었습니까?

해결책

I can't tell you why this is happening, but I can suggest a workaround. When I commented out the entire contents of the main.m file that was generated for my Titanium project, I was able to compile successfully and run on the Simulator. Let me know if that works for you.

다른 팁

Check to see if you have multiple declarations of main function in your project.

I just spent a couple hours battling this one. It was because I was using the -all_load linker flag. If you are using that flag to get around the category bug, there are some other solutions -- see here.

I had a similar problem. A unit test class was accidentally included in my build. If you search your project for "main(" you'll probably find the duplicate functions.

나는 답을 발견했습니다 ... 고 상승 된 사용 권한으로이를 실행해야했습니다.

private void ActivateWorkflow(byte[] doc, string teamRoomUrl)
{
    SPSecurity.RunWithElevatedPrivileges(delegate()
    {
        try
        {
            NintexWorkflowWS.NintexWorkflowWS webService = new NintexWorkflowWS.NintexWorkflowWS();
            webService.Url = teamRoomUrl.TrimEnd('/') + "/_vti_bin/nintexworkflow/workflow.asmx";
            webService.UseDefaultCredentials = true;
            webService.PublishFromNWF(doc, "Documents", "Move Documents", true);
        }
        catch (Exception ex)
        {
            //log
        }
    });
}
.

이것은 "최상의"방법이 아닐 수도 있지만 그것은 작동 할 것입니다.

의 모든 발생을 대체합니다.

$('.ce').focus(function(){
.

$('.ce').unbind("focus").focus(function(){
.

두 스크립트 모두에서

이벤트 위임이 될수록 더 좋은 방법은 코드를 더 많이 변경합니다.

Seems as though there are multiple ways to get into this state. Mine was different. I read a hint where you could drag from a .xib event selector into the .h implementation of your view controller and it would auto-gen your methods. It did - which was cool. I immediately started getting duplicate symbol errors - which was not cool.

I did not have time to dig deep into the linker to see what happened. I created a new view controller, copied the context of my old .xib into the new guy. Deleted the old .h, .m and .xib and built and it worked again. Very odd, very annoying time waste.

There is obviously some bug with this xcode "convenience".

I found this happened when i had an implementation file with a main function in it (say abc.m) and also had another main.m. Once I commented out the main function in abc.m, the project compiled successfully.

Based off what I can tell from these other answers, I'm going to need to be remove a bunch of main methods.

But to do that easily I first need to remove all the gd comments from my files because they are assiduously documented with comments at nearly every other line

This regular expression matches all C multi-line comments including their delimeters & may help you on your journey

/\*((?!\*/).)*\*/

I spent more than an hour in searching for a correct answer but nothing worked for me. Finally the xcode it self telling something is duplicated, so go to that particular folder(in this case: /Users/prithviraj/Documents/project/Final/build/iphone/build/Final.build/Debug-iphonesimulator/Final.build/Objects-normal/i386/main.o) and delete all the files and also check same in your project whether that particular class/interface is declared twice if yes delete it.

After deletion clean and run the project.

It worked for me hope this helps(-_-).

Delete /Users/{username}/Library/Developer/Xcode/DerivedData folder and build again.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top