PDA

View Full Version : Compile QT4.2.2 with MySQL on Mac OS



asd
11th February 2007, 20:33
Hello!

Need help!



$gcc -v
Using built-in specs.
Target: i686-apple-darwin8
Configured with: /private/var/tmp/gcc/gcc-5250.obj~20/src/configure --disable-checking -enable-werror --prefix=/usr --mandir=/share/man --enable-languages=c,objc,c++,obj-c++ --program-transform-name=/^[cg][^.-]*$/s/$/-4.0/ --with-gxx-include-dir=/include/c++/4.0.0 --build=powerpc-apple-darwin8 --with-arch=pentium-m --with-tune=prescott --program-prefix= --host=i686-apple-darwin8 --target=i686-apple-darwin8
Thread model: posix
gcc version 4.0.1 (Apple Computer, Inc. build 5250)

$mysql -V
mysql Ver 14.12 Distrib 5.0.33, for apple-darwin8.8.1 (i686) using EditLine wrapper

$ env
TERM_PROGRAM=Apple_Terminal
TERM=xterm-color
SHELL=/bin/bash
TERM_PROGRAM_VERSION=133
OLDPWD=/Users/asd
USER=asd
__CF_USER_TEXT_ENCODING=0x1F5:7:49
PATH=/bin:/sbin:/usr/bin:/usr/local/bin:/usr/sbin:/Developer/Tools:/opt/local/bin:/opt/local/libexec:/opt/local/sbin:/sw/bin:/usr/local/Trolltech/Qt-4.2.1/bin:
/usr/local/mysql:/usr/local/mysql/include:/usr/local/mysql/bin
PWD=/Users/asd/Downloads/qt-mac-opensource-src-4.2.2
SHLVL=1
HOME=/Users/asd
_=/usr/bin/env

$./configure -qt-sql-mysql -universal -qt-gif -platform macx-g++
...
Build type: macx-g++
Architecture: macosx

Build ............... libs tools examples
Configuration ....... build_all debug shared dll largefile stl sse x86 ppc absolute_library_soname qt3support accessibility opengl minimal-config small-config medium-config large-config full-config reduce_exports ipv6 getaddrinfo ipv6ifname getifaddrs png gif no-freetype system-zlib cups gnu-libiconv release debug qt_framework x86 ppc
Debug................ yes (combined)
Default Link......... debug
Qt 3 compatibility... yes
QtDBus module........ no
STL support ......... yes
PCH support ......... no
MMX/SSE support ..... yes
IPv6 support ........ yes
IPv6 ifname support . yes
getaddrinfo support . yes
getifaddrs support... yes
Accessibility ....... yes
NIS support ......... no
CUPS support ........ yes
Iconv support ....... gnu
Glib support ........ auto
Large File support .. yes
GIF support ......... yes
JPEG support ........ plugin (qt)
PNG support ......... yes (qt)
MNG support ......... plugin (qt)
zlib support ........ system
OpenGL support ...... yes
MySQL support ....... qt
ODBC support ........ plugin
SQLite support ...... plugin (qt)
...
Qt is now configured for building. Just run 'make'.
Once everything is built, you must run 'make install'.
Qt will be installed into /usr/local/Trolltech/Qt-4.2.2

To reconfigure, run 'make confclean' and 'configure'.

$make
...
c++ -c -pipe -I/Users/asd/Downloads/mysql-5.0.33/include/ -fconstant-cfstrings -I/usr/local/mysql/include/mysql -g -g -fvisibility=hidden -fvisibility-inlines-hidden -Wall -W -F/Users/asd/Downloads/qt-mac-opensource-src-4.2.2/lib -arch ppc -arch i386 -fPIC -DQT_SHARED -DQT_BUILD_SQL_LIB -DQT_NO_CAST_TO_ASCII -DQT_ASCII_CAST_WARNINGS -DQT3_SUPPORT -DQT_MOC_COMPAT -DQT_NO_CAST_FROM_ASCII -DQT_CORE_LIB -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -I../../mkspecs/macx-g++ -I. -I../../include/QtCore -I../../include/QtCore -I../../include -I../../include/QtSql -I.moc/debug-shared -I.uic/debug-shared -o .obj/debug-shared/moc_qsqltablemodel.o .moc/debug-shared/moc_qsqltablemodel.cpp
/Users/asd/Downloads/qt-mac-opensource-src-4.2.2/bin/moc -DQT_SHARED -DQT_BUILD_SQL_LIB -DQT_NO_CAST_TO_ASCII -DQT_ASCII_CAST_WARNINGS -DQT3_SUPPORT -DQT_MOC_COMPAT -DQT_NO_CAST_FROM_ASCII -DQT_CORE_LIB -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -I../../mkspecs/macx-g++ -I. -I../../include/QtCore -I../../include/QtCore -I../../include -I../../include/QtSql -I.moc/debug-shared -I.uic/debug-shared -D__APPLE__ -D__GNUC__ models/qsqlrelationaltablemodel.h -o .moc/debug-shared/moc_qsqlrelationaltablemodel.cpp
c++ -c -pipe -I/Users/asd/Downloads/mysql-5.0.33/include/ -fconstant-cfstrings -I/usr/local/mysql/include/mysql -g -g -fvisibility=hidden -fvisibility-inlines-hidden -Wall -W -F/Users/asd/Downloads/qt-mac-opensource-src-4.2.2/lib -arch ppc -arch i386 -fPIC -DQT_SHARED -DQT_BUILD_SQL_LIB -DQT_NO_CAST_TO_ASCII -DQT_ASCII_CAST_WARNINGS -DQT3_SUPPORT -DQT_MOC_COMPAT -DQT_NO_CAST_FROM_ASCII -DQT_CORE_LIB -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -I../../mkspecs/macx-g++ -I. -I../../include/QtCore -I../../include/QtCore -I../../include -I../../include/QtSql -I.moc/debug-shared -I.uic/debug-shared -o .obj/debug-shared/moc_qsqlrelationaltablemodel.o .moc/debug-shared/moc_qsqlrelationaltablemodel.cpp
rm -f QtSql_debug QtSql.framework/QtSql_debug ../../lib/QtSql.framework/QtSql_debug
c++ -headerpad_max_install_names -arch ppc -arch i386 -single_module -dynamiclib -compatibility_version 4.2 -current_version 4.2.2 -install_name /usr/local/Trolltech/Qt-4.2.2/lib/QtSql.framework/Versions/4/QtSql_debug -o QtSql_debug .obj/debug-shared/qsqlquery.o .obj/debug-shared/qsqldatabase.o .obj/debug-shared/qsqlfield.o .obj/debug-shared/qsqlrecord.o .obj/debug-shared/qsqldriver.o .obj/debug-shared/qsqldriverplugin.o .obj/debug-shared/qsqlerror.o .obj/debug-shared/qsqlresult.o .obj/debug-shared/qsqlindex.o .obj/debug-shared/qsqlcachedresult.o .obj/debug-shared/qsql_mysql.o .obj/debug-shared/qsqlquerymodel.o .obj/debug-shared/qsqltablemodel.o .obj/debug-shared/qsqlrelationaldelegate.o .obj/debug-shared/qsqlrelationaltablemodel.o .obj/debug-shared/moc_qsqldriver.o .obj/debug-shared/moc_qsqldriverplugin.o .obj/debug-shared/moc_qsql_mysql.o .obj/debug-shared/moc_qsqlquerymodel.o .obj/debug-shared/moc_qsqltablemodel.o .obj/debug-shared/moc_qsqlrelationaltablemodel.o -L/usr/local/mysql/lib/ -F/Users/asd/Downloads/qt-mac-opensource-src-4.2.2/lib -L/Users/asd/Downloads/qt-mac-opensource-src-4.2.2/lib -L/usr/local/mysql/lib/mysql -lmysqlclient_r -framework QtCore -L/usr/local/mysql/lib/ -L/Users/asd/Downloads/qt-mac-opensource-src-4.2.2/lib -lz -lm -liconv -framework ApplicationServices
ld: Undefined symbols:
_mysql_affected_rows
_mysql_character_set_name
_mysql_close
_mysql_data_seek
_mysql_errno
_mysql_error
_mysql_fetch_field
_mysql_fetch_field_direct
_mysql_fetch_lengths
_mysql_fetch_row
_mysql_field_count
_mysql_field_seek
_mysql_free_result
_mysql_get_client_version
_mysql_get_server_version
_mysql_init
_mysql_insert_id
_mysql_list_fields
_mysql_list_tables
_mysql_num_fields
_mysql_num_rows
_mysql_query
_mysql_real_connect
_mysql_real_escape_string
_mysql_real_query
_mysql_select_db
_mysql_server_end
_mysql_server_init
_mysql_set_character_set
_mysql_stmt_affected_rows
_mysql_stmt_attr_set
_mysql_stmt_bind_param
_mysql_stmt_bind_result
_mysql_stmt_close
_mysql_stmt_data_seek
_mysql_stmt_errno
_mysql_stmt_error
_mysql_stmt_execute
_mysql_stmt_fetch
_mysql_stmt_init
_mysql_stmt_insert_id
_mysql_stmt_num_rows
_mysql_stmt_param_count
_mysql_stmt_prepare
_mysql_stmt_reset
_mysql_stmt_result_metadata
_mysql_stmt_store_result
_mysql_store_result
/usr/bin/libtool: internal link edit command failed
lipo: can't figure out the architecture type of: /var/tmp//cczl3dai.out
make[3]: *** [../../lib/QtSql.framework/QtSql_debug] Error 1
make[2]: *** [debug-all] Error 2
make[1]: *** [sub-sql-make_default] Error 2
make: *** [sub-src-make_default-ordered] Error 2

:confused:

What`s wrong whith it?

jacek
11th February 2007, 21:39
c++ -c -pipe -I/Users/asd/Downloads/mysql-5.0.33/include/ ... -I/usr/local/mysql/include/mysql ...
It looks like you have two incompatible MySQL versions installed and Qt took the headers from one location and the library from the second one.

Pass -L and -I options to configure, so that it knows exactly which MySQL version it should use.

asd
11th February 2007, 21:43
/Users/asd/Downloads/mysql-5.0.33/include/ - sources

usr/local/mysql/include/mysql - compilled program

:-)

asd
11th February 2007, 21:47
Now running the follow:

$ make confclean;./configure -qt-sql-mysql -universal -qt-gif -platform macx-g++ -I /usr/local/mysql/include/ -L /usr/local/mysql/lib/ ;make

:o

asd
11th February 2007, 22:30
the same result :crying:
HELP!!!

asd
12th February 2007, 12:24
Now running the follow:

$ make confclean;./configure -qt-sql-mysql -universal -qt-gif -platform macx-g++ -I /usr/local/mysql/include/ -L /usr/local/mysql/lib/ ;make

:o


$ make confclean;./configure -qt-sql-mysql -qt-gif -platform macx-g++ -I /usr/local/mysql/include/ -L /usr/local/mysql/lib/ ;make

works perfectly as I havn`t mysql for PPC :)

Another truble... When I tried to compile with the static key (-static) I had less disk space

before compilling about 15Gb after 0 :-) and the process terminated with the low disk space...

Is this Ok?

jacek
12th February 2007, 15:43
before compilling about 15Gb after 0 :-) and the process terminated with the low disk space...

Is this Ok?
Yes, static builds are huge. Make sure you execute "make sub-src" instead of "make", otherwise demos and examples will eat all of your disk space.

asd
12th February 2007, 15:50
Yes, static builds are huge. Make sure you execute "make sub-src" instead of "make", otherwise demos and examples will eat all of your disk space.

Ok... Thanks.