1

这是雪豹(gcc 4.2.1)上的 XCode 3.2.6。试图编译一个Hello World 程序并得到一个段错误,并带有如下所示的崩溃报告(这是在尝试 Learn C the Hard Way 中的第一个示例)。任何可能的解决方案的提示都会很棒。

此外,当您尝试打开或创建项目时,XCode 会崩溃并显示“+entityForName: could not locate an NSManagedObjectModel for entity name 'DTExtensionPointDescription'”。

Process:         as [44911]
Path:            /usr/bin/as
Identifier:      as
Version:         ??? (???)
Code Type:       X86-64 (Native)
Parent Process:  i686-apple-darwin10-gcc-4.2.1 [44909]

Date/Time:       2012-06-11 08:47:14.521 -0400
OS Version:      Mac OS X 10.6.8 (10K549)
Report Version:  6

Exception Type:  EXC_BAD_ACCESS (SIGSEGV)
Exception Codes: KERN_INVALID_ADDRESS at 0x0000000000000000
Crashed Thread:  0  Dispatch queue: com.apple.main-thread

Thread 0 Crashed:  Dispatch queue: com.apple.main-thread
0   libSystem.B.dylib               0x00007fff851cdad2 rindex + 8
1   as                              0x0000000100000775 0x100000000 + 1909
2   as                              0x00000001000006d4 0x100000000 + 1748

Thread 0 crashed with X86 Thread State (64-bit):
  rax: 0x0000000000000000  rbx: 0x00007fff5fbff2a0  rcx: 0x000000000000002f  rdx: 0x0000000000000000
  rdi: 0x0000000000000000  rsi: 0x000000000000002f  rbp: 0x00007fff5fbfee40  rsp: 0x00007fff5fbfee40
   r8: 0x0000000000000001   r9: 0x8080808080808080  r10: 0x00007fff8a96c169  r11: 0x00007fff851cdaca
  r12: 0x00007fff5fbfee98  r13: 0x0000000000000000  r14: 0x00007fff5fbff708  r15: 0x0000000000000007
  rip: 0x00007fff851cdad2  rfl: 0x0000000000010246  cr2: 0x0000000000000000

Binary Images:
       0x100000000 -        0x100002fff  as ??? (???) <44A4A2BA-257C-914C-FA97-714D15FFDBE1> /usr/libexec/gcc/i686-apple-darwin10/4.2.1/as
    0x7fff5fc00000 -     0x7fff5fc3be0f  dyld 132.1 (???) <DD3F7F3E-8612-A7BD-F508-9EF29132C419> /usr/lib/dyld
    0x7fff82f8a000 -     0x7fff82f8eff7  libmathCommon.A.dylib 315.0.0 (compatibility 1.0.0) <95718673-FEEE-B6ED-B127-BCDBDB60D4E5> /usr/lib/system/libmathCommon.A.dylib
    0x7fff85191000 -     0x7fff85352fef  libSystem.B.dylib 125.2.11 (compatibility 1.0.0) <9AB4F1D1-89DC-0E8A-DC8E-A4FE4D69DB69> /usr/lib/libSystem.B.dylib
    0x7fffffe00000 -     0x7fffffe01fff  libSystem.B.dylib ??? (???) <9AB4F1D1-89DC-0E8A-DC8E-A4FE4D69DB69> /usr/lib/libSystem.B.dylib

这里有一些有趣的东西——这里是我系统上所有的“as”二进制文件(和/或链接):

/Developer/usr/bin/as
/Developer/usr/libexec/gcc/darwin/i386/as
/Developer/usr/libexec/gcc/darwin/ppc/as
/Developer/usr/libexec/gcc/darwin/ppc64/as
/Developer/usr/libexec/gcc/darwin/x86_64/as
/Developer/usr/libexec/gcc/i686-apple-darwin10/4.0.1/as
/Developer/usr/libexec/gcc/i686-apple-darwin10/4.2.1/as
/Developer/usr/libexec/gcc/powerpc-apple-darwin10/4.0.1/as
/Developer/usr/libexec/gcc/powerpc-apple-darwin10/4.2.1/as
/Developer/usr/llvm-gcc-4.2/libexec/gcc/i686-apple-darwin10/4.2.1/as
/Developer/usr/llvm-gcc-4.2/libexec/gcc/powerpc-apple-darwin10/4.2.1/as

段错误是 i686 的(即使在没有输入的情况下调用)。有没有办法(一个环境变量)我可以用来告诉 GCC 使用 x86_64 架构(我在 i7 上,所以无论如何它应该是合适的)

4

1 回答 1

1

Hello World 程序的重点是确认您的编译系统正在工作并且您知道如何使用它。

用 Hello World 炸毁汇编器非常清楚地表明您的编译系统无法正常工作。

于 2012-06-11T14:06:54.880 回答