I recently upgraded my Mac Book Pro to Lion and faced challenges with MacPorts application that I had with me. I had downloaded and installed XCode 4.2 from the app store (very un - appstore like installation BTW - you click install on the app store but it only downloaded the app. You need to separately install it) before I did the selfupdate but it does not seem to matter. The application fails with the following errors (relevant sections below) -

/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)

As far as I tell I should not be having issues but it looks like I do not have any option but to reinstall MacPorts and all the applications under it.

  • I have added this question so I can point out the answer. When I was searching for the answer I did not see any of the StackOverflow sites in the list and felt that this question should be added here as well. – Nikhil Oct 17 '11 at 15:10
  • PS: I was using MacPorts 2.0.1 when running the selfupdate. I am now at 2.0.3 – Nikhil Oct 17 '11 at 15:15
  • Thanks so much for this -- it would have taken me a hundred years to figure this out. – shanusmagnus Apr 16 '12 at 16:27

I found the answer when I was searching on Google using the error messages as search queries.

Basically the problem is because I had installed the Mono framework as well and for some weird reason MacPorts was using the version of SQL Lite bundled in the Mono Framework during its make and install steps. This version of SQL Lite is not compatible with the MacPorts application and as result the install failed.

The workaround is to temporarily move the /Library/Frameworks/Mono.framework/ somewhere else and then run the selfupdate command. Once the selfupdate is done move the folder back to /Library/Frameworks/Mono.framework/.

I got the solution from Mark who had kindly blogged about it here - http://itandbiscuits.blogspot.com/2011/09/macports-mono.html

  • 1
    The problem is that the Mono installer adds /usr/bin/pkg-config that causes everything to be linked against the Mono Framework. This binary does not exist in a clean OS X install. Thus, it is actually a bug in Mono, not in MacPorts. Workarounds are being discussed in a ticket in the MacPorts issue tracker. – raimue Nov 1 '11 at 15:50
  • Bug has been filed in the Mono bug tracker as well - bugzilla.xamarin.com/show_bug.cgi?id=1154 – Nikhil Mar 4 '12 at 5:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.