Версия для печати темы
Нажмите сюда для просмотра этой темы в оригинальном формате
Форум программистов > С/С++: Кроссплатформенное программирование, Qt/Gtk+/wxWidgets > Не получается настроить SQL драйвер


Автор: Ober 11.3.2013, 22:24
Помогите пожалуйста, не получается настроить SQL драйве, сижу два дня ничего не получается.Перепробовал кучу вариантов из разных источников. Qt версия 5.0.1 MySQL версия 5.6.10. Подскажите пожалуйста как это сделать.
После того как делаю 

qmake mysql.pro
mingw32-make

Создаются некоторые файл в директории C:\Qt\5.0.1\Src\qtbase\src\plugins\sqldrivers\mysql Но на сколько я читал та должны создаваться папки. При этом в командной строке печатается следующее

mingw32-make -f Makefile.Release all
mingw32-make[1]: Entering directory 'C:/Qt/5.0.1/Src/qtbase/src/plugins/sqldrive
rs/mysql'
g++ -Wl,-s -shared -Wl,--out-implib,C:\Qt\5.0.1\Src\qtbase\plugins\sqldrivers\li
bqsqlmysql.a -o ..\..\..\..\plugins\sqldrivers\qsqlmysql.dll .obj/release_shared
/main.o .obj/release_shared/qsql_mysql.o .obj/release_shared/moc_qsql_mysql.o  -
Lc:/MySQL/lib -llibmysql -LC:\Qt\5.0.1\mingw47_32\lib -lQt5Sql -lQt5Core
c:/qt/tools/mingw/bin/../lib/gcc/i686-w64-mingw32/4.7.2/../../../../i686-w64-min
gw32/bin/ld.exe: skipping incompatible c:/MySQL/lib/libmysql.dll when searching
for -llibmysql
c:/qt/tools/mingw/bin/../lib/gcc/i686-w64-mingw32/4.7.2/../../../../i686-w64-min
gw32/bin/ld.exe: skipping incompatible c:/MySQL/lib/libmysql.dll when searching
for -llibmysql
c:/qt/tools/mingw/bin/../lib/gcc/i686-w64-mingw32/4.7.2/../../../../i686-w64-min
gw32/bin/ld.exe: cannot find -llibmysql
collect2.exe: error: ld returned 1 exit status
Makefile.Release:80: recipe for target '..\..\..\..\plugins\sqldrivers\qsqlmysql
.dll' failed
mingw32-make[1]: *** [..\..\..\..\plugins\sqldrivers\qsqlmysql.dll] Error 1
mingw32-make[1]: Leaving directory 'C:/Qt/5.0.1/Src/qtbase/src/plugins/sqldriver
s/mysql'
makefile:38: recipe for target 'release-all' failed
mingw32-make: *** [release-all] Error 2


Я так понимаю он не может найти llibmysql, но где он должен быть и где его взять? Помогите пожалуйста Курсовая горит.

Автор: borisbn 12.3.2013, 08:41
а ты добавлял 
Цитата
"INCLUDEPATH+=C:\MySQL\include" "LIBS+=C:\MYSQL\MySQL Server <version>\lib\opt\libmysql.lib"

в qmake как http://qt-project.org/doc/qt-4.8/sql-driver.html#how-to-build-the-qmysql-plugin-on-windows ?

Автор: Ober 12.3.2013, 22:59
Цитата(borisbn @ 12.3.2013,  08:41)
а ты добавлял 
Цитата
"INCLUDEPATH+=C:\MySQL\include" "LIBS+=C:\MYSQL\MySQL Server <version>\lib\opt\libmysql.lib"

в qmake как http://qt-project.org/doc/qt-4.8/sql-driver.html#how-to-build-the-qmysql-plugin-on-windows ?

Если пытаюсь вводить

cd %QTDIR%\src\plugins\sqldrivers\mysql
 qmake "INCLUDEPATH+=C:\MySQL\include" "LIBS+=C:\MYSQL\MySQL Server <version>\lib\opt\libmysql.lib" mysql.pro
 nmake


Сообщение об ошибке Cannot find file: make.
При этом в C:\Qt\Qt5.0.1\5.0.1\Src\qtbase\src\plugins\sqldrivers\mysql создаются файлы MakeFile.debug, MakeFile.release и другие

Я пытаюсь настроить по следующему алгоритму 
1) Открываю C:\Qt\Qt5.0.1\5.0.1\Src\qtbase\src\plugins\sqldrivers\mysql\mysq.pro
2)Прописываю в нем путь к MySQL 
INCLUDEPATH +="C:/MySQL/include"
LIBS+="C:/MySQL/lib/libmysql.lib"
3) далее в консоли Qt SDK ввожу
cd C:\Qt\Qt5.0.1\5.0.1\Src\qtbase\src\plugins\sqldrivers\mysql
4) далее qmake mysql.pro При этом в каталоге создаются некоторые файлы
5) далее mingw32-make при этом в консоли отображается следующее, посмотрите пожалуйста может вы поймете ?

C:\Qt\Qt5.0.1\5.0.1\mingw47_32>cd C:\Qt\Qt5.0.1\5.0.1\Src\qtbase\src\plugins\sql
drivers\mysql
 
C:\Qt\Qt5.0.1\5.0.1\Src\qtbase\src\plugins\sqldrivers\mysql>qmake mysql.pro
 
C:\Qt\Qt5.0.1\5.0.1\Src\qtbase\src\plugins\sqldrivers\mysql>mingw32-make
mingw32-make -f Makefile.Release all
mingw32-make[1]: Entering directory 'C:/Qt/Qt5.0.1/5.0.1/Src/qtbase/src/plugins/
sqldrivers/mysql'
C:\Qt\Qt5.0.1\5.0.1\mingw47_32\bin\moc.exe -DUNICODE -DQT_NO_CAST_TO_ASCII -DQT_
NO_CAST_FROM_ASCII -DQT_NO_EXCEPTIONS -DQT_NO_DEBUG -DQT_PLUGIN -DQT_SQL_LIB -DQ
T_CORE_LIB -I. -I"C:\MySQL\include" -I"C:\Qt\Qt5.0.1\5.0.1\mingw47_32\include" -
I"C:\Qt\Qt5.0.1\5.0.1\mingw47_32\include\QtSql" -I"C:\Qt\Qt5.0.1\5.0.1\mingw47_3
2\include\QtSql\5.0.1" -I"C:\Qt\Qt5.0.1\5.0.1\mingw47_32\include\QtSql\5.0.1\QtS
ql" -I"C:\Qt\Qt5.0.1\5.0.1\mingw47_32\include\QtCore" -I".moc\release_shared" -I
"..\..\..\..\mkspecs\win32-g++" -D__GNUC__ -DWIN32 main.cpp -o .moc\release_shar
ed\main.moc
g++ -c -pipe -fno-keep-inline-dllexport -O2 -std=c++0x -fno-exceptions -frtti -W
all -Wextra -DUNICODE -DQT_NO_CAST_TO_ASCII -DQT_NO_CAST_FROM_ASCII -DQT_NO_EXCE
PTIONS -DQT_NO_DEBUG -DQT_PLUGIN -DQT_SQL_LIB -DQT_CORE_LIB -I. -I"C:\MySQL\incl
ude" -I"C:\Qt\Qt5.0.1\5.0.1\mingw47_32\include" -I"C:\Qt\Qt5.0.1\5.0.1\mingw47_3
2\include\QtSql" -I"C:\Qt\Qt5.0.1\5.0.1\mingw47_32\include\QtSql\5.0.1" -I"C:\Qt
\Qt5.0.1\5.0.1\mingw47_32\include\QtSql\5.0.1\QtSql" -I"C:\Qt\Qt5.0.1\5.0.1\ming
w47_32\include\QtCore" -I".moc\release_shared" -I"..\..\..\..\mkspecs\win32-g++"
 -o .obj\release_shared\main.o main.cpp
C:\Qt\Qt5.0.1\5.0.1\mingw47_32\bin\moc.exe -DUNICODE -DQT_NO_CAST_TO_ASCII -DQT_
NO_CAST_FROM_ASCII -DQT_NO_EXCEPTIONS -DQT_NO_DEBUG -DQT_PLUGIN -DQT_SQL_LIB -DQ
T_CORE_LIB -I. -I"C:\MySQL\include" -I"C:\Qt\Qt5.0.1\5.0.1\mingw47_32\include" -
I"C:\Qt\Qt5.0.1\5.0.1\mingw47_32\include\QtSql" -I"C:\Qt\Qt5.0.1\5.0.1\mingw47_3
2\include\QtSql\5.0.1" -I"C:\Qt\Qt5.0.1\5.0.1\mingw47_32\include\QtSql\5.0.1\QtS
ql" -I"C:\Qt\Qt5.0.1\5.0.1\mingw47_32\include\QtCore" -I".moc\release_shared" -I
"..\..\..\..\mkspecs\win32-g++" -D__GNUC__ -DWIN32 ..\..\..\sql\drivers\mysql\qs
ql_mysql.cpp -o .moc\release_shared\qsql_mysql.moc
g++ -c -pipe -fno-keep-inline-dllexport -O2 -std=c++0x -fno-exceptions -frtti -W
all -Wextra -DUNICODE -DQT_NO_CAST_TO_ASCII -DQT_NO_CAST_FROM_ASCII -DQT_NO_EXCE
PTIONS -DQT_NO_DEBUG -DQT_PLUGIN -DQT_SQL_LIB -DQT_CORE_LIB -I. -I"C:\MySQL\incl
ude" -I"C:\Qt\Qt5.0.1\5.0.1\mingw47_32\include" -I"C:\Qt\Qt5.0.1\5.0.1\mingw47_3
2\include\QtSql" -I"C:\Qt\Qt5.0.1\5.0.1\mingw47_32\include\QtSql\5.0.1" -I"C:\Qt
\Qt5.0.1\5.0.1\mingw47_32\include\QtSql\5.0.1\QtSql" -I"C:\Qt\Qt5.0.1\5.0.1\ming
w47_32\include\QtCore" -I".moc\release_shared" -I"..\..\..\..\mkspecs\win32-g++"
 -o .obj\release_shared\qsql_mysql.o ..\..\..\sql\drivers\mysql\qsql_mysql.cpp
C:\Qt\Qt5.0.1\5.0.1\mingw47_32\bin\moc.exe -DUNICODE -DQT_NO_CAST_TO_ASCII -DQT_
NO_CAST_FROM_ASCII -DQT_NO_EXCEPTIONS -DQT_NO_DEBUG -DQT_PLUGIN -DQT_SQL_LIB -DQ
T_CORE_LIB -I. -I"C:\MySQL\include" -I"C:\Qt\Qt5.0.1\5.0.1\mingw47_32\include" -
I"C:\Qt\Qt5.0.1\5.0.1\mingw47_32\include\QtSql" -I"C:\Qt\Qt5.0.1\5.0.1\mingw47_3
2\include\QtSql\5.0.1" -I"C:\Qt\Qt5.0.1\5.0.1\mingw47_32\include\QtSql\5.0.1\QtS
ql" -I"C:\Qt\Qt5.0.1\5.0.1\mingw47_32\include\QtCore" -I".moc\release_shared" -I
"..\..\..\..\mkspecs\win32-g++" -D__GNUC__ -DWIN32 ..\..\..\sql\drivers\mysql\qs
ql_mysql.h -o .moc\release_shared\moc_qsql_mysql.cpp
g++ -c -pipe -fno-keep-inline-dllexport -O2 -std=c++0x -fno-exceptions -frtti -W
all -Wextra -DUNICODE -DQT_NO_CAST_TO_ASCII -DQT_NO_CAST_FROM_ASCII -DQT_NO_EXCE
PTIONS -DQT_NO_DEBUG -DQT_PLUGIN -DQT_SQL_LIB -DQT_CORE_LIB -I. -I"C:\MySQL\incl
ude" -I"C:\Qt\Qt5.0.1\5.0.1\mingw47_32\include" -I"C:\Qt\Qt5.0.1\5.0.1\mingw47_3
2\include\QtSql" -I"C:\Qt\Qt5.0.1\5.0.1\mingw47_32\include\QtSql\5.0.1" -I"C:\Qt
\Qt5.0.1\5.0.1\mingw47_32\include\QtSql\5.0.1\QtSql" -I"C:\Qt\Qt5.0.1\5.0.1\ming
w47_32\include\QtCore" -I".moc\release_shared" -I"..\..\..\..\mkspecs\win32-g++"
 -o .obj\release_shared\moc_qsql_mysql.o .moc\release_shared\moc_qsql_mysql.cpp
g++ -Wl,-s -shared -Wl,--out-implib,C:\Qt\Qt5.0.1\5.0.1\Src\qtbase\plugins\sqldr
ivers\libqsqlmysql.a -o ..\..\..\..\plugins\sqldrivers\qsqlmysql.dll .obj/releas
e_shared/main.o .obj/release_shared/qsql_mysql.o .obj/release_shared/moc_qsql_my
sql.o  C:/MySQL/lib/libmysql.lib -LC:\Qt\Qt5.0.1\5.0.1\mingw47_32\lib -lQt5Sql -
lQt5Core
.obj/release_shared/qsql_mysql.o:qsql_mysql.cpp:(.text+0x1ce): undefined referen
ce to `mysql_stmt_insert_id@4'
.obj/release_shared/qsql_mysql.o:qsql_mysql.cpp:(.text+0x209): undefined referen
ce to `mysql_insert_id@4'
.obj/release_shared/qsql_mysql.o:qsql_mysql.cpp:(.text+0x26c): undefined referen
ce to `mysql_num_rows@4'
.obj/release_shared/qsql_mysql.o:qsql_mysql.cpp:(.text+0x297): undefined referen
ce to `mysql_stmt_num_rows@4'
.obj/release_shared/qsql_mysql.o:qsql_mysql.cpp:(.text+0x2e5): undefined referen
ce to `mysql_num_rows@4'
.obj/release_shared/qsql_mysql.o:qsql_mysql.cpp:(.text+0x31b): undefined referen
ce to `mysql_stmt_num_rows@4'
.obj/release_shared/qsql_mysql.o:qsql_mysql.cpp:(.text+0x601): undefined referen
ce to `mysql_stmt_error@4'
.obj/release_shared/qsql_mysql.o:qsql_mysql.cpp:(.text+0x60e): undefined referen
ce to `mysql_stmt_errno@4'
.obj/release_shared/qsql_mysql.o:qsql_mysql.cpp:(.text+0x788): undefined referen
ce to `mysql_character_set_name@4'
.obj/release_shared/qsql_mysql.o:qsql_mysql.cpp:(.text+0x831): undefined referen
ce to `mysql_error@4'
.obj/release_shared/qsql_mysql.o:qsql_mysql.cpp:(.text+0x840): undefined referen
ce to `mysql_errno@4'
.obj/release_shared/qsql_mysql.o:qsql_mysql.cpp:(.text+0x9e7): undefined referen
ce to `mysql_errno@4'
.obj/release_shared/qsql_mysql.o:qsql_mysql.cpp:(.text+0xb78): undefined referen
ce to `mysql_errno@4'
.obj/release_shared/qsql_mysql.o:qsql_mysql.cpp:(.text+0xb8f): undefined referen
ce to `mysql_field_seek@8'
.obj/release_shared/qsql_mysql.o:qsql_mysql.cpp:(.text+0xbbc): undefined referen
ce to `mysql_field_seek@8'
.obj/release_shared/qsql_mysql.o:qsql_mysql.cpp:(.text+0xbc7): undefined referen
ce to `mysql_fetch_field@4'
.obj/release_shared/qsql_mysql.o:qsql_mysql.cpp:(.text+0xc10): undefined referen
ce to `mysql_fetch_field@4'
.obj/release_shared/qsql_mysql.o:qsql_mysql.cpp:(.text+0xe62): undefined referen
ce to `mysql_stmt_data_seek@12'
.obj/release_shared/qsql_mysql.o:qsql_mysql.cpp:(.text+0xe73): undefined referen
ce to `mysql_stmt_fetch@4'
.obj/release_shared/qsql_mysql.o:qsql_mysql.cpp:(.text+0xede): undefined referen
ce to `mysql_data_seek@12'
.obj/release_shared/qsql_mysql.o:qsql_mysql.cpp:(.text+0xeef): undefined referen
ce to `mysql_fetch_row@4'
.obj/release_shared/qsql_mysql.o:qsql_mysql.cpp:(.text+0x101c): undefined refere
nce to `mysql_fetch_row@4'
.obj/release_shared/qsql_mysql.o:qsql_mysql.cpp:(.text+0x106a): undefined refere
nce to `mysql_stmt_fetch@4'
.obj/release_shared/qsql_mysql.o:qsql_mysql.cpp:(.text+0x12a5): undefined refere
nce to `mysql_fetch_lengths@4'
.obj/release_shared/qsql_mysql.o:qsql_mysql.cpp:(.text+0x220f): undefined refere
nce to `mysql_init@4'
.obj/release_shared/qsql_mysql.o:qsql_mysql.cpp:(.text+0x2370): undefined refere
nce to `mysql_real_connect@32'
.obj/release_shared/qsql_mysql.o:qsql_mysql.cpp:(.text+0x25ad): undefined refere
nce to `mysql_close@4'
.obj/release_shared/qsql_mysql.o:qsql_mysql.cpp:(.text+0x2781): undefined refere
nce to `mysql_real_connect@32'
.obj/release_shared/qsql_mysql.o:qsql_mysql.cpp:(.text+0x27f6): undefined refere
nce to `mysql_set_character_set@8'
.obj/release_shared/qsql_mysql.o:qsql_mysql.cpp:(.text+0x2816): undefined refere
nce to `mysql_get_client_version@0'
.obj/release_shared/qsql_mysql.o:qsql_mysql.cpp:(.text+0x2830): undefined refere
nce to `mysql_thread_init@0'
.obj/release_shared/qsql_mysql.o:qsql_mysql.cpp:(.text+0x2918): undefined refere
nce to `mysql_select_db@8'
.obj/release_shared/qsql_mysql.o:qsql_mysql.cpp:(.text+0x2a35): undefined refere
nce to `mysql_close@4'
.obj/release_shared/qsql_mysql.o:qsql_mysql.cpp:(.text+0x2abd): undefined refere
nce to `mysql_options@12'
.obj/release_shared/qsql_mysql.o:qsql_mysql.cpp:(.text+0x2add): undefined refere
nce to `mysql_get_server_version@4'
.obj/release_shared/qsql_mysql.o:qsql_mysql.cpp:(.text+0x2b60): undefined refere
nce to `mysql_thread_end@0'
.obj/release_shared/qsql_mysql.o:qsql_mysql.cpp:(.text+0x2b6d): undefined refere
nce to `mysql_close@4'
.obj/release_shared/qsql_mysql.o:qsql_mysql.cpp:(.text+0x3181): undefined refere
nce to `mysql_list_fields@12'
.obj/release_shared/qsql_mysql.o:qsql_mysql.cpp:(.text+0x31e9): undefined refere
nce to `mysql_fetch_field@4'
.obj/release_shared/qsql_mysql.o:qsql_mysql.cpp:(.text+0x31f8): undefined refere
nce to `mysql_free_result@4'
.obj/release_shared/qsql_mysql.o:qsql_mysql.cpp:(.text+0x32d3): undefined refere
nce to `mysql_query@8'
.obj/release_shared/qsql_mysql.o:qsql_mysql.cpp:(.text+0x3433): undefined refere
nce to `mysql_query@8'
.obj/release_shared/qsql_mysql.o:qsql_mysql.cpp:(.text+0x3593): undefined refere
nce to `mysql_query@8'
.obj/release_shared/qsql_mysql.o:qsql_mysql.cpp:(.text+0x38cd): undefined refere
nce to `mysql_real_escape_string@16'
.obj/release_shared/qsql_mysql.o:qsql_mysql.cpp:(.text+0x3d22): undefined refere
nce to `mysql_get_server_version@4'
.obj/release_shared/qsql_mysql.o:qsql_mysql.cpp:(.text+0x4183): undefined refere
nce to `mysql_list_tables@8'
.obj/release_shared/qsql_mysql.o:qsql_mysql.cpp:(.text+0x41c6): undefined refere
nce to `mysql_data_seek@12'
.obj/release_shared/qsql_mysql.o:qsql_mysql.cpp:(.text+0x41d1): undefined refere
nce to `mysql_fetch_row@4'
.obj/release_shared/qsql_mysql.o:qsql_mysql.cpp:(.text+0x42d4): undefined refere
nce to `mysql_free_result@4'
.obj/release_shared/qsql_mysql.o:qsql_mysql.cpp:(.text+0x4447): undefined refere
nce to `mysql_free_result@4'
.obj/release_shared/qsql_mysql.o:qsql_mysql.cpp:(.text+0x4465): undefined refere
nce to `mysql_next_result@4'
.obj/release_shared/qsql_mysql.o:qsql_mysql.cpp:(.text+0x4482): undefined refere
nce to `mysql_stmt_close@4'
.obj/release_shared/qsql_mysql.o:qsql_mysql.cpp:(.text+0x44ab): undefined refere
nce to `mysql_free_result@4'
.obj/release_shared/qsql_mysql.o:qsql_mysql.cpp:(.text+0x4563): undefined refere
nce to `mysql_store_result@4'
.obj/release_shared/qsql_mysql.o:qsql_mysql.cpp:(.text+0x485d): undefined refere
nce to `mysql_real_query@12'
.obj/release_shared/qsql_mysql.o:qsql_mysql.cpp:(.text+0x4960): undefined refere
nce to `mysql_store_result@4'
.obj/release_shared/qsql_mysql.o:qsql_mysql.cpp:(.text+0x4984): undefined refere
nce to `mysql_field_count@4'
.obj/release_shared/qsql_mysql.o:qsql_mysql.cpp:(.text+0x49cb): undefined refere
nce to `mysql_affected_rows@4'
.obj/release_shared/qsql_mysql.o:qsql_mysql.cpp:(.text+0x4a93): undefined refere
nce to `mysql_fetch_field_direct@8'
.obj/release_shared/qsql_mysql.o:qsql_mysql.cpp:(.text+0x4b0a): undefined refere
nce to `mysql_field_count@4'
.obj/release_shared/qsql_mysql.o:qsql_mysql.cpp:(.text+0x4bba): undefined refere
nce to `mysql_num_fields@4'
.obj/release_shared/qsql_mysql.o:qsql_mysql.cpp:(.text+0x4cc3): undefined refere
nce to `mysql_fetch_field@4'
.obj/release_shared/qsql_mysql.o:qsql_mysql.cpp:(.text+0x4db4): undefined refere
nce to `mysql_stmt_result_metadata@4'
.obj/release_shared/qsql_mysql.o:qsql_mysql.cpp:(.text+0x4e5a): undefined refere
nce to `mysql_stmt_prepare@12'
.obj/release_shared/qsql_mysql.o:qsql_mysql.cpp:(.text+0x4e73): undefined refere
nce to `mysql_stmt_param_count@4'
.obj/release_shared/qsql_mysql.o:qsql_mysql.cpp:(.text+0x4f06): undefined refere
nce to `mysql_stmt_init@4'
.obj/release_shared/qsql_mysql.o:qsql_mysql.cpp:(.text+0x50ca): undefined refere
nce to `mysql_stmt_param_count@4'
.obj/release_shared/qsql_mysql.o:qsql_mysql.cpp:(.text+0x539c): undefined refere
nce to `mysql_next_result@4'
.obj/release_shared/qsql_mysql.o:qsql_mysql.cpp:(.text+0x53c3): undefined refere
nce to `mysql_store_result@4'
.obj/release_shared/qsql_mysql.o:qsql_mysql.cpp:(.text+0x53dc): undefined refere
nce to `mysql_field_count@4'
.obj/release_shared/qsql_mysql.o:qsql_mysql.cpp:(.text+0x5434): undefined refere
nce to `mysql_affected_rows@4'
.obj/release_shared/qsql_mysql.o:qsql_mysql.cpp:(.text+0x54c7): undefined refere
nce to `mysql_fetch_field_direct@8'
.obj/release_shared/qsql_mysql.o:qsql_mysql.cpp:(.text+0x5667): undefined refere
nce to `mysql_free_result@4'
.obj/release_shared/qsql_mysql.o:qsql_mysql.cpp:(.text+0x582d): undefined refere
nce to `mysql_stmt_reset@4'
.obj/release_shared/qsql_mysql.o:qsql_mysql.cpp:(.text+0x5a0d): undefined refere
nce to `mysql_stmt_param_count@4'
.obj/release_shared/qsql_mysql.o:qsql_mysql.cpp:(.text+0x5a26): undefined refere
nce to `mysql_stmt_execute@4'
.obj/release_shared/qsql_mysql.o:qsql_mysql.cpp:(.text+0x5a80): undefined refere
nce to `mysql_stmt_affected_rows@4'
.obj/release_shared/qsql_mysql.o:qsql_mysql.cpp:(.text+0x5ab0): undefined refere
nce to `mysql_stmt_bind_result@8'
.obj/release_shared/qsql_mysql.o:qsql_mysql.cpp:(.text+0x5ad3): undefined refere
nce to `mysql_stmt_store_result@4'
.obj/release_shared/qsql_mysql.o:qsql_mysql.cpp:(.text+0x5b01): undefined refere
nce to `mysql_stmt_bind_result@8'
.obj/release_shared/qsql_mysql.o:qsql_mysql.cpp:(.text+0x5c7a): undefined refere
nce to `mysql_stmt_param_count@4'
.obj/release_shared/qsql_mysql.o:qsql_mysql.cpp:(.text+0x6075): undefined refere
nce to `mysql_stmt_bind_param@8'
.obj/release_shared/qsql_mysql.o:qsql_mysql.cpp:(.text+0x649c): undefined refere
nce to `mysql_stmt_attr_set@12'
c:/qt/qt5.0.1/tools/mingw/bin/../lib/gcc/i686-w64-mingw32/4.7.2/../../../../i686
-w64-mingw32/bin/ld.exe: .obj/release_shared/qsql_mysql.o: bad reloc address 0x4
 in section `.data'
collect2.exe: error: ld returned 1 exit status
Makefile.Release:80: recipe for target '..\..\..\..\plugins\sqldrivers\qsqlmysql
.dll' failed
mingw32-make[1]: *** [..\..\..\..\plugins\sqldrivers\qsqlmysql.dll] Error 1
mingw32-make[1]: Leaving directory 'C:/Qt/Qt5.0.1/5.0.1/Src/qtbase/src/plugins/s
qldrivers/mysql'
makefile:38: recipe for target 'release-all' failed
mingw32-make: *** [release-all] Error 2
 
C:\Qt\Qt5.0.1\5.0.1\Src\qtbase\src\plugins\sqldrivers\mysql>

Автор: borisbn 13.3.2013, 06:38
C:/MySQL/lib/libmysql.lib - этот файл лежит именно по этому пути?
Если да, то, пожалуй, у тебя такая же проблема, что и у меня с Interbase - http://stackoverflow.com/questions/15153182/howto-build-interbase-plugin-for-qt-by-mingw

Пожалуй, нужно бусткодера помучить...

Автор: Sovereign 13.3.2013, 08:08
с interbase была проблема в библиотеке, подбирал нужную чтоб скомпилировалось нормально (решил проблему года три назад, поэтому подробностей не помню). Исходники по interbase в приложении, там все в куче, с pro файла должно нормально собраться (Qt 4.6+, mingw). Postgres и oracle собирались по инструкции нормально, mysql не приходилось пока собирать, сорри за оффтоп

p.s c библиотекой mysql возможно такая же проблема, что она была собрана под visual c++, а нужна та которая под mingw

Автор: borisbn 13.3.2013, 08:57
Sovereign, спасибо !!!
Дело, правда, оказалось не в lib-файлах, а в заголовочном файле из SDK Interbas'а ibase.h.
Там стояло
Код
#if (defined(_MSC_VER) && defined(_WIN32)) || \
    (defined(__BORLANDC__) && (defined(__WIN32__) || defined(__OS2__)))
#define  ISC_EXPORT    __stdcall
...

а в том файле, что Вы дали (судя по всему это не IB, а FB), было просто
Код
#if defined(WIN32) || defined(_WIN32) || defined(__WIN32__)
#define  ISC_EXPORT    __stdcall
...

Я сделал у себя в каталоге SDK Interbase также и всё завелось.
2 Ober, посмотри соответствующие файлы в SDK MySQL. Или выложи сюда их h-ники. Поковыряем...

Sovereign, если у Вас есть аккаунт на СОшке, то предлагаю ответить (по ссылке в моём предыдущем сообщении), а я приму ответ.

Автор: Ober 15.3.2013, 01:12
Спасибо, за помощь, я рылся в интернете и нашел интересное видео, просто в SDK 5.0.1 эта процедура отличается от той которую нужно было делать в предыдущих версиях. Кому интересно можете глянуть:
http://www.youtube.com/watch?v=n8GzbdCkby8

Powered by Invision Power Board (http://www.invisionboard.com)
© Invision Power Services (http://www.invisionpower.com)