PDA

View Full Version : Mysql drivers install problems



cyberboy
30th January 2008, 15:26
Hi guys,

I'm new in the world of QT and I like it allready.
But I'm developing a program that needs mysql drivers, so I searched the net and found the documentation on the Trolltech site, but I can't get it done.

I've downloaded the mysql-5.0.51a-macosx-universal.tar.bz from the mysql site (174 MB:eek:) and dropped it in the folder /usr/local/mysql-5.0.51a/ and I ran the sudo ./configure command without succes.

Afterwards I followed the Trolltech documentation and ran the following commands:

sudo cd /usr/local/Trolltech/Qt*/plugins/sqldrivers/
sudo mkdir mysql
cd mysql

sudo qmake -project
sudo qmake -o Makefile "INCLUDEPATH+=/usr/local/mysql-5.0.51a/include" "LIBS+=-L/usr/local/mysql-5.0.51a/lib -lmysqlclient_r" mysql.pro
sudo make

But it doesn't work I get the message:

make: Nothing to be done for `first'.

Can somebody help me, I trying for two days but it won't work.

Thanks,

Cyberboy

jacek
30th January 2008, 21:36
Afterwards I followed the Trolltech documentation and ran the following commands:
sudo cd /usr/local/Trolltech/Qt*/plugins/sqldrivers/
sudo mkdir mysql
cd mysql

sudo qmake -project
Could you post a link to the part of Qt docs that say you should run these commands?

Do you have Qt sources installed?

cyberboy
31st January 2008, 18:39
This is the documentation link:


http://doc.trolltech.com/4.3/sql-driver.html#qmysql-for-mysql-4-and-higher

And how can I see if I have the QT sources installed?

jpn
31st January 2008, 19:07
There was no $QTDIR/src/plugins/sqldrivers/mysql? I don't see any step including mkdir in the docs. Neither should you run qmake -project which destroys the project file..

cyberboy
31st January 2008, 19:48
hmm... I know but.. It seems to be a logical step, because qmake -o Makefile etc.. didn't work without the project file.

But how can I solve this?

jpn
31st January 2008, 20:10
My point was, that the plugin dir, including main.cpp and mysql.pro project file should have been there in the first place. You might need to restore the original project file. Running "qmake -project" overrode the project file with so called default project file.

jacek
31st January 2008, 20:12
But how can I solve this?
First you need Qt sources. How did you install Qt on your system?

cyberboy
1st February 2008, 08:27
I read the instructions from the Trolltech site


http://doc.trolltech.com/4.3/install-mac.html

All the examples and all the tools are installed, so I used the make command.

ashukla
1st February 2008, 08:49
I read the instructions from the Trolltech site



All the examples and all the tools are installed, so I used the make command.
Take a look of this.
http://doc.trolltech.com/4.3/sql-driver.html#how-to-build-the-qmysql-plugin-on-unix-and-mac-os-x

cyberboy
1st February 2008, 10:18
cd $QTDIR/src/plugins/sqldrivers/mysql
This would be in my case cd /usr/local/Trolltech/Qt*/src/plugins/sqldrivers/mysql/
But this directory doesn't exist, but I found the /usr/local/Trolltech/Qt*/plugins/sqldrivers/
directory and I did the sudo mkdir mysql, now I have the directory.


qmake -o Makefile "INCLUDEPATH+=/usr/local/include" "LIBS+=-L/usr/local/lib -lmysqlclient_r" mysql.pro

This would be in my case sudo qmake -o Makefile "INCLUDEPATH+=/usr/local/mysql*/include" "LIBS+=-L/usr/local/mysql*/lib -lmysqlclient_r" mysql.pro
But than I get the message : "Cannot find file: mysql.pro."

So I ran the sudo qmake -project command to get a mysql.pro file.
Afterwards I ran the sudo qmake -o Makefile.... command, with succes.
And than the make command, but I get the message "make: Nothing to be done for `first'."

So I'm really messing up something but what?:eek:

jpn
1st February 2008, 11:00
As Jacek already pointed out, you need the sources. You can't just make an empty dir and pretend they're there... :)

ashukla
1st February 2008, 11:52
Use the Seprate source for it as JPN suggested.
And then,

qmake -o Makefile "INCLUDEPATH+=/usr/include/mysql" "LIBS+=-L/usr/lib/mysql -lmysqlclient_r" mysql.pro
I had compiled with this. Because the corresponding header and .so files are in my system in that location. So, Try with this. I hope it's help.

jacek
1st February 2008, 14:29
I read the instructions from the Trolltech site
http://doc.trolltech.com/4.3/install-mac.html
If you were following these instructions, then the Qt sources should be in /tmp/qt-mac-.../ directory. Could you check if they're still there?

cyberboy
1st February 2008, 17:41
I downloaded a new file qt-4.3.2 from the Trolltech site. I copied the source directory from the download into my current installation.

The next thing I did was installing the x86 version from mysql.com. (mysql 5.0.51a)

And I did what the Trolltech QMYSQL guide said.

But after I ran the command : sudo make I get this

sudo make
Password:
make -f Makefile.Debug
c++ -c -pipe -g -fvisibility=hidden -fvisibility-inlines-hidden -Wall -W -fPIC -DQT_NO_CAST_TO_ASCII -DQT_NO_CAST_FROM_ASCII -DQT_PLUGIN -DQT_SQL_LIB -DQT_CORE_LIB -DQT_SHARED -I../../../../mkspecs/macx-g++ -I. -I../../../../lib/QtCore.framework/Versions/4/Headers -I../../../../include/QtCore -I../../../../include/QtCore -I../../../../lib/QtSql.framework/Versions/4/Headers -I../../../../include/QtSql -I../../../../include/QtSql -I../../../../include -I/usr/include/mysql -Idebug -I. -F/usr/local/Trolltech/Qt-4.3.2/lib -o debug/main.o main.cpp
In file included from main.cpp:41:
../../../sql/drivers/mysql/qsql_mysql.h:49:19: error: mysql.h: No such file or directory
../../../sql/drivers/mysql/qsql_mysql.h:100: error: expected `)' before '*' token
make[1]: *** [debug/main.o] Error 1
make: *** [debug] Error 2


But if I run the command nano ../../../sql/drivers/mysql/qsql_mysql.h from the same location as make. I'm in the qsql_mysql.h file.
So it does exist!?:confused:

I'm a little bit confused right now, the make files says that the directory doesn't exist but the nano command says it does.

What do I have to do know?

igor
1st February 2008, 18:24
Hi guys,
I've downloaded the mysql-5.0.51a-macosx-universal.tar.bz from the mysql site (174 MB:eek:) and dropped it in the folder /usr/local/mysql-5.0.51a/ and I ran the sudo ./configure command without succes.

:eek:

First Silly Question: Do you have a working MySQL ? Sounds like you do not because you said the configure command ran without succes. :confused:

Next Silly Question: Did you install Qt by using qt-mac-opensource-4.3.2.dmg ? If so, that is not source. You need to get qt-mac-opensource-src-4.3.2.tar.gz and build it. :o

cyberboy
1st February 2008, 18:31
All right, the first install of mysql was messed up, so I download the pkg file from mysql.com and ran it.
With succes, I think, because afterward the directory /usr/local/mysql exists :)

And I don't know if I installed the QT source version, but I downloaded the qt-mac-opensource-src-4.3.2.tar.gz and copied the src folder into my installation.

And than I did what I said in my previous post

igor
1st February 2008, 19:05
I downloaded the qt-mac-opensource-src-4.3.2.tar.gz and copied the src folder into my installation.

:confused: Did you build it ? As described here (http://doc.trolltech.com/4.3/install-mac.html) ? :eek:

jacek
1st February 2008, 20:42
And I don't know if I installed the QT source version, but I downloaded the qt-mac-opensource-src-4.3.2.tar.gz and copied the src folder into my installation.
Don't copy any directories. Configure the sources, build the plugin and then copy only the plugin.

cyberboy
2nd February 2008, 12:29
Okay, now I'm installing Qt-4.3.3 with the this configure flags on:
./configure -qt-sql-mysql -qt-sql-odbc -qt-sql-sqlite -universal

And allmost everything went fine except for mysql this is the message I get:


MySQL support cannot be enabled due to functionality tests!
Turn on verbose messaging (-v) to ./configure to see the final report.
If you believe this message is in error you may use the continue
switch (-continue) to ./configure to continue.


And this is the message with the verbose flag turned on:


Creating qmake. Please wait...
make: Nothing to be done for `first'.
floatmath auto-detection... ()
c++ -c -pipe -Os -Wall -W -I/usr/local/Trolltech/Qt-4.3.2/mkspecs/macx-g++ -I. -I. -o floatmath.o floatmath.cpp
floatmath.cpp:3: warning: unused parameter 'argc'
floatmath.cpp:3: warning: unused parameter 'argv'
c++ -headerpad_max_install_names -o floatmath.app/Contents/MacOS/floatmath floatmath.o
floatmath disabled.
mmx auto-detection... ()
c++ -c -pipe -mmmx -Os -Wall -W -I/usr/local/Trolltech/Qt-4.3.2/mkspecs/macx-g++ -I. -I. -o mmx.o mmx.cpp
c++ -headerpad_max_install_names -o mmx.app/Contents/MacOS/mmx mmx.o -mmmx
mmx disabled.
3dnow auto-detection... ()
c++ -c -pipe -m3dnow -Os -Wall -W -I/usr/local/Trolltech/Qt-4.3.2/mkspecs/macx-g++ -I. -I. -o 3dnow.o 3dnow.cpp
c++ -headerpad_max_install_names -o 3dnow.app/Contents/MacOS/3dnow 3dnow.o -m3dnow
3dnow disabled.
sse auto-detection... ()
c++ -c -pipe -msse -Os -Wall -W -I/usr/local/Trolltech/Qt-4.3.2/mkspecs/macx-g++ -I. -I. -o sse.o sse.cpp
c++ -headerpad_max_install_names -o sse.app/Contents/MacOS/sse sse.o -msse
sse disabled.
sse2 auto-detection... ()
c++ -c -pipe -msse2 -Os -Wall -W -I/usr/local/Trolltech/Qt-4.3.2/mkspecs/macx-g++ -I. -I. -o sse2.o sse2.cpp
c++ -headerpad_max_install_names -o sse2.app/Contents/MacOS/sse2 sse2.o -msse2
sse2 disabled.
zlib auto-detection... ()
c++ -c -pipe -Os -Wall -W -I/usr/local/Trolltech/Qt-4.3.2/mkspecs/macx-g++ -I. -I. -o zlib.o zlib.cpp
c++ -headerpad_max_install_names -o zlib zlib.o -lz
zlib enabled.
libjpeg auto-detection... ()
c++ -c -pipe -Os -Wall -W -I/usr/local/Trolltech/Qt-4.3.2/mkspecs/macx-g++ -I. -I. -o libjpeg.o libjpeg.cpp
libjpeg.cpp:4:21: error: jpeglib.h: No such file or directory
libjpeg.cpp: In function 'int main(int, char**)':
libjpeg.cpp:9: error: 'j_compress_ptr' was not declared in this scope
libjpeg.cpp:9: error: expected `;' before 'cinfo'
libjpeg.cpp:10: error: 'cinfo' was not declared in this scope
libjpeg.cpp:10: error: 'jpeg_create_compress' was not declared in this scope
make: *** [libjpeg.o] Error 1
libjpeg disabled.
libtiff auto-detection... ()
c++ -c -pipe -Os -Wall -W -I/usr/local/Trolltech/Qt-4.3.2/mkspecs/macx-g++ -I. -I. -o libtiff.o libtiff.cpp
libtiff.cpp:1:20: error: tiffio.h: No such file or directory
libtiff.cpp:4:6: error: #error "Required libtiff not found"
libtiff.cpp: In function 'int main(int, char**)':
libtiff.cpp:11: error: 'tdata_t' was not declared in this scope
libtiff.cpp:11: error: expected `;' before 'buffer'
libtiff.cpp:12: error: 'buffer' was not declared in this scope
libtiff.cpp:12: error: '_TIFFfree' was not declared in this scope
make: *** [libtiff.o] Error 1
libtiff disabled.
libmng auto-detection... ()
c++ -c -pipe -Os -Wall -W -I/usr/local/Trolltech/Qt-4.3.2/mkspecs/macx-g++ -I. -I. -o libmng.o libmng.cpp
libmng.cpp:1:20: error: libmng.h: No such file or directory
libmng.cpp:9:2: error: #error System libmng version is less than 1.0.9; using built-in version instead.
libmng.cpp: In function 'int main(int, char**)':
libmng.cpp:5: error: 'mng_handle' was not declared in this scope
libmng.cpp:5: error: expected `;' before 'hMNG'
libmng.cpp:6: error: 'hMNG' was not declared in this scope
libmng.cpp:6: error: 'mng_cleanup' was not declared in this scope
make: *** [libmng.o] Error 1
libmng disabled.
libpng auto-detection... ()
c++ -c -pipe -Os -Wall -W -I/usr/local/Trolltech/Qt-4.3.2/mkspecs/macx-g++ -I. -I. -o libpng.o libpng.cpp
libpng.cpp:1:17: error: png.h: No such file or directory
libpng.cpp:4:4: error: #error "Required libpng version 1.0.17 not found."
libpng.cpp: In function 'int main(int, char**)':
libpng.cpp:9: error: 'png_structp' was not declared in this scope
libpng.cpp:9: error: expected `;' before 'png_ptr'
libpng.cpp:10: error: 'png_ptr' was not declared in this scope
libpng.cpp:10: error: 'PNG_LIBPNG_VER_STRING' was not declared in this scope
libpng.cpp:10: error: 'png_create_read_struct' was not declared in this scope
make: *** [libpng.o] Error 1
libpng disabled.
InterBase auto-detection... ()
c++ -c -pipe -Os -Wall -W -I/usr/local/Trolltech/Qt-4.3.2/mkspecs/macx-g++ -I. -I. -o ibase.o ibase.cpp
ibase.cpp:1:19: error: ibase.h: No such file or directory
make: *** [ibase.o] Error 1
InterBase disabled.
MySQL (thread-safe) auto-detection... ()
c++ -c -pipe -Os -Wall -W -I/usr/local/Trolltech/Qt-4.3.2/mkspecs/macx-g++ -I. -I. -o mysql.o ../mysql/mysql.cpp
../mysql/mysql.cpp:1:19: error: mysql.h: No such file or directory
make: *** [mysql.o] Error 1
MySQL (thread-safe) disabled.
MySQL (thread-unsafe) auto-detection... ()
c++ -c -pipe -Os -Wall -W -I/usr/local/Trolltech/Qt-4.3.2/mkspecs/macx-g++ -I. -I. -o mysql.o mysql.cpp
mysql.cpp:1:19: error: mysql.h: No such file or directory
make: *** [mysql.o] Error 1
MySQL (thread-unsafe) disabled.
MySQL support cannot be enabled due to functionality tests!
Turn on verbose messaging (-v) to ./configure to see the final report.
If you believe this message is in error you may use the continue
switch (-continue) to ./configure to continue.


And that's just crazy he's now looking in the old qtdir?

cyberboy
2nd February 2008, 12:49
Hmm.... the ./configure succeed, but therefore I had to remove the -qt-sql-mysql parameter and I replaced the qt-sql-<driver> by -plugin-sql-<driver>

Right now I'm running the make, I hope that I've got the sqlite drivers installed right know so I can do at least something with a database:)

P.S. This is an installation of the qt-mac-opensource-src-4.3.2

cyberboy
2nd February 2008, 14:11
I think I've found it:)


./configure -qt-sql-mysql -I/usr/local/mysql/include -L/usr/local/mysql/lib -qt-sql-odbc -qt-sql-sqlite -universal -v


Thanks for all you're help guys:)