我最近将我的 Mac Book Pro 升级到 Lion,并遇到了我随身携带的 MacPorts 应用程序的问题。在进行自我更新之前,我已经从应用商店下载并安装了 XCode 4.2(顺便说一句,安装方式非常不像应用商店 - 您单击应用商店上的安装,但它只下载了应用程序。您需要单独安装它),但这似乎并不重要。应用程序失败并出现以下错误(相关部分如下)-
/Library/Frameworks/Mono.framework/Versions/2.10.6/include/sqlite3.h:252: warning: ISO C90 does not support ‘long long’
/Library/Frameworks/Mono.framework/Versions/2.10.6/include/sqlite3.h:253: warning: ISO C90 does not support ‘long long’
/usr/bin/cc -c -DUSE_TCL_STUBS -DTCL_NO_DEPRECATED -g -O2 -W -Wall -pedantic -I/Library/Frameworks/Mono.framework/Versions/2.10.6/include -DHAVE_CONFIG_H -I.. -I. -I"/usr/include" -fno-common util.c -o util.o
In file included from util.h:36,
from util.c:37:
/Library/Frameworks/Mono.framework/Versions/2.10.6/include/sqlite3.h:252: warning: ISO C90 does not support ‘long long’
/Library/Frameworks/Mono.framework/Versions/2.10.6/include/sqlite3.h:253: warning: ISO C90 does not support ‘long long’
.
.
.
/usr/bin/cc -dynamiclib -g -O2 -W -Wall -pedantic -I/Library/Frameworks/Mono.framework/Versions/2.10.6/include -Wl,-single_module registry.o util.o entry.o entryobj.o ../cregistry/cregistry.a -o registry.dylib -L/System/Library/Frameworks/Tcl.framework/Versions/8.5 -ltclstub8.5 -L/Library/Frameworks/Mono.framework/Versions/2.10.6/lib -lsqlite3
ld: warning: ignoring file
/Library/Frameworks/Mono.framework/Versions/2.10.6/lib/libsqlite3.dylib, file was built for unsupported file format which is not the architecture being linked (x86_64)
Undefined symbols for architecture x86_64:
"_sqlite3_errmsg", referenced from:
_set_sqlite_result in util.o
_reg_sqlite_error in cregistry.a(registry.o)
_reg_detach in cregistry.a(registry.o)
_reg_close in cregistry.a(registry.o)
_reg_attach in cregistry.a(registry.o)
_reg_open in cregistry.a(registry.o)
.
.
.
.
"_sqlite3_create_collation", referenced from:
_init_db in cregistry.a(sql.o)
ld: symbol(s) not found for architecture x86_64
collect2: ld returned 1 exit status
make[2]: *** [registry.dylib] Error 1
make[1]: *** [all] Error 1
make: *** [all] Error 1
shell command "cd /opt/local/var/macports/sources/rsync.macports.org/release/tarballs/base && CC=/usr/bin/cc ./configure --prefix=/opt/local --with-tclpackage=/Library/Tcl --with-install-user=root --with-install-group=admin --with-directory-mode=0755 --enable-readline && make &&
make install" returned error 2
Error: /opt/local/bin/port: port selfupdate failed: Error installing new MacPorts base: shell command failed (see log for details)
据我所知,我应该不会遇到问题,但看起来我别无选择,只能重新安装 MacPorts 及其下的所有应用程序。
答案1
当我使用错误消息作为搜索查询在 Google 上搜索时,我找到了答案。
基本上,问题是因为我也安装了 Mono 框架,但出于某种奇怪的原因,MacPorts 在制作和安装步骤中使用了 Mono 框架中捆绑的 SQL Lite 版本。此版本的 SQL Lite 与 MacPorts 应用程序不兼容,因此安装失败。
解决方法是暂时将 /Library/Frameworks/Mono.framework/ 移至其他位置,然后运行 selfupdate 命令。selfupdate 完成后,将文件夹移回 /Library/Frameworks/Mono.framework/。
我从马克那里得到了解决方案,他曾在博客中提到过这个问题 -http://itandbiscuits.blogspot.com/2011/09/macports-mono.html