Page 2 of 2 FirstFirst 12
Results 21 to 26 of 26

Thread: Problem Wtih Connecting MySQL Database on Windows

  1. #21
    Join Date
    Feb 2009
    Posts
    39
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Problem Wtih Connecting MySQL Database on Windows

    Thanks for your reply,

    I have a doubt regarding cleaning. Which directory i need to clean QT directory or MySQL directory.

    Waiting for your reply.


    Regards,

    Narasimha Raju. Naidu

  2. #22
    Join Date
    Feb 2009
    Posts
    39
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Problem Wtih Connecting MySQL Database on Windows

    Thanks for your reply,


    According to your suggestion i executed make clean command. i got the following output
    Qt Code:
    1. C:\Qt\4.3.4\src\plugins\sqldrivers\mysql>make clean
    2. mingw32-make -f Makefile.Release clean
    3. mingw32-make[1]: Entering directory `C:/Qt/4.3.4/src/plugins/sqldrivers/mysql'
    4. del tmp\moc\release_shared\moc_qsql_mysql.cpp
    5. del tmp\obj\release_shared\main.o tmp\obj\release_shared\qsql_mysql.o tmp\obj\re
    6. lease_shared\moc_qsql_mysql.o
    7. del c:\Qt\4.3.4\plugins\sqldrivers\libqsqlmysql4.a
    8. del tmp\obj\release_shared\qsqlmysql_resource_res.o
    9. mingw32-make[1]: Leaving directory `C:/Qt/4.3.4/src/plugins/sqldrivers/mysql'
    10. mingw32-make -f Makefile.Debug clean
    11. mingw32-make[1]: Entering directory `C:/Qt/4.3.4/src/plugins/sqldrivers/mysql'
    12. del tmp\moc\debug_shared\moc_qsql_mysql.cpp
    13. Could Not Find C:\Qt\4.3.4\src\plugins\sqldrivers\mysql\tmp\moc\debug_shared\moc
    14. _qsql_mysql.cpp
    15. del tmp\obj\debug_shared\main.o tmp\obj\debug_shared\qsql_mysql.o tmp\obj\debug_
    16. shared\moc_qsql_mysql.o
    17. Could Not Find C:\Qt\4.3.4\src\plugins\sqldrivers\mysql\tmp\obj\debug_shared\mai
    18. n.o
    19. del c:\Qt\4.3.4\plugins\sqldrivers\libqsqlmysqld4.a
    20. Could Not Find c:\Qt\4.3.4\plugins\sqldrivers\libqsqlmysqld4.a
    21. del tmp\obj\debug_shared\qsqlmysqld_resource_res.o
    22. Could Not Find C:\Qt\4.3.4\src\plugins\sqldrivers\mysql\tmp\obj\debug_shared\qsq
    23. lmysqld_resource_res.o
    24. mingw32-make[1]: Leaving directory `C:/Qt/4.3.4/src/plugins/sqldrivers/mysql'
    25. del c:\Qt\4.3.4\plugins\sqldrivers\libqsqlmysql4.a
    26. Could Not Find c:\Qt\4.3.4\plugins\sqldrivers\libqsqlmysql4.a
    To copy to clipboard, switch view to plain text mode 

    then after i executed mingw32-make then i got the following error.

    Qt Code:
    1. C:\Qt\4.3.4\src\plugins\sqldrivers\mysql>mingw32-make
    2. mingw32-make -f Makefile.Release
    3. mingw32-make[1]: Entering directory `C:/Qt/4.3.4/src/plugins/sqldrivers/mysql'
    4. g++ -c -O2 -frtti -fexceptions -mthreads -Wall -DUNICODE -DQT_LARGEFILE_SUPPORT
    5. -DQT_NO_CAST_TO_ASCII -DQT_NO_CAST_FROM_ASCII -DQT_DLL -DQT_NO_DEBUG -DQT_PLUGIN
    6. -DQT_SQL_LIB -DQT_CORE_LIB -DQT_THREAD_SUPPORT -I"..\..\..\..\include\QtCore" -
    7. I"..\..\..\..\include\QtCore" -I"..\..\..\..\include\QtSql" -I"..\..\..\..\inclu
    8. de\QtSql" -I"..\..\..\..\include" -I"c:\Qt\4.3.4\include\ActiveQt" -I"tmp\moc\re
    9. lease_shared" -I"." -I"..\..\..\..\mkspecs\win32-g++" -o tmp\obj\release_shared\
    10. main.o main.cpp
    11. In file included from main.cpp:46:
    12. ../../../sql/drivers/mysql/qsql_mysql.h:54:19: mysql.h: No such file or director
    13. y
    14. In file included from main.cpp:46:
    15. ../../../sql/drivers/mysql/qsql_mysql.h:105: error: expected `)' before '*' toke
    16. n
    17. mingw32-make[1]: *** [tmp/obj/release_shared/main.o] Error 1
    18. mingw32-make[1]: Leaving directory `C:/Qt/4.3.4/src/plugins/sqldrivers/mysql'
    19. mingw32-make: *** [release] Error 2
    20.  
    21. C:\Qt\4.3.4\src\plugins\sqldrivers\mysql>
    To copy to clipboard, switch view to plain text mode 

    What should i do now

    Waiting for your reply.

    Regards,

    Narasimha Raju. Naidu

  3. #23
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    4,380
    Thanks
    19
    Thanked 1,005 Times in 913 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60
    Wiki edits
    5

    Default Re: Problem Wtih Connecting MySQL Database on Windows

    OK, following steps:
    1. Clean your build directory again, delete the MAKEFILE!
    2. run qmake with the path to your MySQL installation again (<- that you have forgotten, see spirits post to set the path)
    3. run make
    4. be happy (in case it build successfully...)

  4. #24
    Join Date
    Feb 2009
    Posts
    39
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Problem Wtih Connecting MySQL Database on Windows

    Thanks for your reply,

    I did what you told, i got the following error.

    Qt Code:
    1. C:\>SET PATH=C:\MinGW\bin;%PATH%
    2.  
    3. C:\>cd MySQL\lib\opt
    4.  
    5. C:\MySQL\lib\opt>impdef libmysql.dll > libmysql.def
    6.  
    7. C:\MySQL\lib\opt>dlltool --dllname libmysql.dll --def libmysql.def --output-lib
    8. libmysql.a
    9.  
    10. C:\MySQL\lib\opt>cd\
    11.  
    12. C:\>cd Qt\4.3.4\src\plugins\sqldrivers\mysql
    13.  
    14. C:\Qt\4.3.4\src\plugins\sqldrivers\mysql>qmake "INCLUDEPATH+=C:\MySQL\include" "
    15. LIBS+=C:\MySQL\lib\opt\libmysql.a" mysql.pro
    16.  
    17. C:\Qt\4.3.4\src\plugins\sqldrivers\mysql>mingw32-make
    18. mingw32-make -f Makefile.Release
    19. mingw32-make[1]: Entering directory `C:/Qt/4.3.4/src/plugins/sqldrivers/mysql'
    20. g++ -c -O2 -frtti -fexceptions -mthreads -Wall -DUNICODE -DQT_LARGEFILE_SUPPORT
    21. -DQT_NO_CAST_TO_ASCII -DQT_NO_CAST_FROM_ASCII -DQT_DLL -DQT_NO_DEBUG -DQT_PLUGIN
    22. -DQT_SQL_LIB -DQT_CORE_LIB -DQT_THREAD_SUPPORT -I"..\..\..\..\include\QtCore" -
    23. I"..\..\..\..\include\QtCore" -I"..\..\..\..\include\QtSql" -I"..\..\..\..\inclu
    24. de\QtSql" -I"..\..\..\..\include" -I"c:\MySQL\include" -I"c:\Qt\4.3.4\include\Ac
    25. tiveQt" -I"tmp\moc\release_shared" -I"." -I"..\..\..\..\mkspecs\win32-g++" -o tm
    26. p\obj\release_shared\main.o main.cpp
    27. g++ -c -O2 -frtti -fexceptions -mthreads -Wall -DUNICODE -DQT_LARGEFILE_SUPPORT
    28. -DQT_NO_CAST_TO_ASCII -DQT_NO_CAST_FROM_ASCII -DQT_DLL -DQT_NO_DEBUG -DQT_PLUGIN
    29. -DQT_SQL_LIB -DQT_CORE_LIB -DQT_THREAD_SUPPORT -I"..\..\..\..\include\QtCore" -
    30. I"..\..\..\..\include\QtCore" -I"..\..\..\..\include\QtSql" -I"..\..\..\..\inclu
    31. de\QtSql" -I"..\..\..\..\include" -I"c:\MySQL\include" -I"c:\Qt\4.3.4\include\Ac
    32. tiveQt" -I"tmp\moc\release_shared" -I"." -I"..\..\..\..\mkspecs\win32-g++" -o tm
    33. p\obj\release_shared\qsql_mysql.o ..\..\..\sql\drivers\mysql\qsql_mysql.cpp
    34. C:/Qt/4.3.4/bin/moc.exe -DUNICODE -DQT_LARGEFILE_SUPPORT -DQT_NO_CAST_TO_ASCII -
    35. DQT_NO_CAST_FROM_ASCII -DQT_DLL -DQT_NO_DEBUG -DQT_PLUGIN -DQT_SQL_LIB -DQT_CORE
    36. _LIB -DQT_THREAD_SUPPORT -I"..\..\..\..\include\QtCore" -I"..\..\..\..\include\Q
    37. tCore" -I"..\..\..\..\include\QtSql" -I"..\..\..\..\include\QtSql" -I"..\..\..\.
    38. .\include" -I"c:\MySQL\include" -I"c:\Qt\4.3.4\include\ActiveQt" -I"tmp\moc\rele
    39. ase_shared" -I"." -I"..\..\..\..\mkspecs\win32-g++" -D__GNUC__ -DWIN32 ..\..\..\
    40. sql\drivers\mysql\qsql_mysql.h -o tmp\moc\release_shared\moc_qsql_mysql.cpp
    41. g++ -c -O2 -frtti -fexceptions -mthreads -Wall -DUNICODE -DQT_LARGEFILE_SUPPORT
    42. -DQT_NO_CAST_TO_ASCII -DQT_NO_CAST_FROM_ASCII -DQT_DLL -DQT_NO_DEBUG -DQT_PLUGIN
    43. -DQT_SQL_LIB -DQT_CORE_LIB -DQT_THREAD_SUPPORT -I"..\..\..\..\include\QtCore" -
    44. I"..\..\..\..\include\QtCore" -I"..\..\..\..\include\QtSql" -I"..\..\..\..\inclu
    45. de\QtSql" -I"..\..\..\..\include" -I"c:\MySQL\include" -I"c:\Qt\4.3.4\include\Ac
    46. tiveQt" -I"tmp\moc\release_shared" -I"." -I"..\..\..\..\mkspecs\win32-g++" -o tm
    47. p\obj\release_shared\moc_qsql_mysql.o tmp\moc\release_shared\moc_qsql_mysql.cpp
    48. windres -i qsqlmysql_resource.rc -o tmp\obj\release_shared\qsqlmysql_resource_re
    49. s.o --include-dir=.
    50. g++ -enable-stdcall-fixup -Wl,-enable-auto-import -Wl,-enable-runtime-pseudo-rel
    51. oc -Wl,-s -mthreads -Wl -shared -Wl,--out-implib,c:\Qt\4.3.4\plugins\sqldrivers\
    52. libqsqlmysql4.a -o ..\..\..\..\plugins\sqldrivers\qsqlmysql4.dll tmp/obj/release
    53. _shared/main.o tmp/obj/release_shared/qsql_mysql.o tmp/obj/release_shared/moc_qs
    54. ql_mysql.o -L"c:\Qt\4.3.4\lib" -L"c:\Qt\4.3.4\lib" tmp\obj\release_shared\qsqlm
    55. ysql_resource_res.o C:\MySQL\lib\opt\libmysql.a -lQtSql4 -lQtCore4
    56. Creating library file: c:\Qt\4.3.4\plugins\sqldrivers\libqsqlmysql4.a
    57. tmp/obj/release_shared/qsql_mysql.o(.text+0x4c):qsql_mysql.cpp: undefined refere
    58. nce to `mysql_character_set_name@4'
    59. tmp/obj/release_shared/qsql_mysql.o(.text+0x184):qsql_mysql.cpp: undefined refer
    60. ence to `mysql_error@4'
    61. tmp/obj/release_shared/qsql_mysql.o(.text+0x19a):qsql_mysql.cpp: undefined refer
    62. ence to `mysql_errno@4'
    63. tmp/obj/release_shared/qsql_mysql.o(.text+0x6d7):qsql_mysql.cpp: undefined refer
    64. ence to `mysql_stmt_error@4'
    65. tmp/obj/release_shared/qsql_mysql.o(.text+0x6eb):qsql_mysql.cpp: undefined refer
    66. ence to `mysql_stmt_errno@4'
    67. tmp/obj/release_shared/qsql_mysql.o(.text+0xa25):qsql_mysql.cpp: undefined refer
    68. ence to `mysql_stmt_data_seek@12'
    69. tmp/obj/release_shared/qsql_mysql.o(.text+0xa39):qsql_mysql.cpp: undefined refer
    70. ence to `mysql_stmt_fetch@4'
    71. tmp/obj/release_shared/qsql_mysql.o(.text+0xb13):qsql_mysql.cpp: undefined refer
    72. ence to `mysql_data_seek@12'
    73. tmp/obj/release_shared/qsql_mysql.o(.text+0xb2a):qsql_mysql.cpp: undefined refer
    74. ence to `mysql_fetch_row@4'
    75. tmp/obj/release_shared/qsql_mysql.o(.text+0xc8f):qsql_mysql.cpp: undefined refer
    76. ence to `mysql_stmt_fetch@4'
    77. .
    78. .
    79. .
    80. .
    81. rence to `mysql_fetch_row@4'
    82. tmp/obj/release_shared/qsql_mysql.o(.text+0x5235):qsql_mysql.cpp: undefined refe
    83. rence to `mysql_free_result@4'
    84. tmp/obj/release_shared/qsql_mysql.o(.text+0x539f):qsql_mysql.cpp: undefined refe
    85. rence to `mysql_stmt_result_metadata@4'
    86. tmp/obj/release_shared/qsql_mysql.o(.text+0x53ba):qsql_mysql.cpp: undefined refe
    87. rence to `mysql_num_fields@4'
    88. tmp/obj/release_shared/qsql_mysql.o(.text+0x54a4):qsql_mysql.cpp: undefined refe
    89. rence to `mysql_fetch_field@4'
    90. tmp/obj/release_shared/qsql_mysql.o(.text+0x56a3):qsql_mysql.cpp: undefined refe
    91. rence to `mysql_next_result@4'
    92. tmp/obj/release_shared/qsql_mysql.o(.text+0x56c1):qsql_mysql.cpp: undefined refe
    93. rence to `mysql_store_result@4'
    94. tmp/obj/release_shared/qsql_mysql.o(.text+0x56d0):qsql_mysql.cpp: undefined refe
    95. rence to `mysql_free_result@4'
    96. tmp/obj/release_shared/qsql_mysql.o(.text+0x56ea):qsql_mysql.cpp: undefined refe
    97. rence to `mysql_next_result@4'
    98. tmp/obj/release_shared/qsql_mysql.o(.text+0x58c2):qsql_mysql.cpp: undefined refe
    99. rence to `mysql_free_result@4'
    100. tmp/obj/release_shared/qsql_mysql.o(.text+0x58e6):qsql_mysql.cpp: undefined refe
    101. rence to `mysql_stmt_close@4'
    102. tmp/obj/release_shared/qsql_mysql.o(.text+0x5bc0):qsql_mysql.cpp: undefined refe
    103. rence to `mysql_stmt_prepare@12'
    104. tmp/obj/release_shared/qsql_mysql.o(.text+0x5ccd):qsql_mysql.cpp: undefined refe
    105. rence to `mysql_stmt_init@4'
    106. tmp/obj/release_shared/qsql_mysql.o(.text+0x5d87):qsql_mysql.cpp: undefined refe
    107. rence to `mysql_stmt_param_count@4'
    108. tmp/obj/release_shared/qsql_mysql.o(.text+0x5da8):qsql_mysql.cpp: undefined refe
    109. rence to `mysql_stmt_param_count@4'
    110. tmp/obj/release_shared/qsql_mysql.o(.text+0x5fde):qsql_mysql.cpp: undefined refe
    111. rence to `mysql_real_query@12'
    112. tmp/obj/release_shared/qsql_mysql.o(.text+0x6164):qsql_mysql.cpp: undefined refe
    113. rence to `mysql_store_result@4'
    114. tmp/obj/release_shared/qsql_mysql.o(.text+0x618a):qsql_mysql.cpp: undefined refe
    115. rence to `mysql_field_count@4'
    116. tmp/obj/release_shared/qsql_mysql.o(.text+0x61af):qsql_mysql.cpp: undefined refe
    117. rence to `mysql_field_count@4'
    118. tmp/obj/release_shared/qsql_mysql.o(.text+0x620d):qsql_mysql.cpp: undefined refe
    119. rence to `mysql_affected_rows@4'
    120. tmp/obj/release_shared/qsql_mysql.o(.text+0x6277):qsql_mysql.cpp: undefined refe
    121. rence to `mysql_fetch_field_direct@8'
    122. tmp/obj/release_shared/qsql_mysql.o(.text+0x6894):qsql_mysql.cpp: undefined refe
    123. rence to `mysql_stmt_reset@4'
    124. tmp/obj/release_shared/qsql_mysql.o(.text+0x6c85):qsql_mysql.cpp: undefined refe
    125. rence to `mysql_stmt_param_count@4'
    126. tmp/obj/release_shared/qsql_mysql.o(.text+0x6ca0):qsql_mysql.cpp: undefined refe
    127. rence to `mysql_stmt_param_count@4'
    128. tmp/obj/release_shared/qsql_mysql.o(.text+0x6cd0):qsql_mysql.cpp: undefined refe
    129. rence to `mysql_stmt_execute@4'
    130. tmp/obj/release_shared/qsql_mysql.o(.text+0x6de5):qsql_mysql.cpp: undefined refe
    131. rence to `mysql_stmt_affected_rows@4'
    132. tmp/obj/release_shared/qsql_mysql.o(.text+0x6e2d):qsql_mysql.cpp: undefined refe
    133. rence to `mysql_stmt_bind_result@8'
    134. tmp/obj/release_shared/qsql_mysql.o(.text+0x6e70):qsql_mysql.cpp: undefined refe
    135. rence to `mysql_stmt_attr_set@12'
    136. tmp/obj/release_shared/qsql_mysql.o(.text+0x6e92):qsql_mysql.cpp: undefined refe
    137. rence to `mysql_stmt_store_result@4'
    138. tmp/obj/release_shared/qsql_mysql.o(.text+0x6edd):qsql_mysql.cpp: undefined refe
    139. rence to `mysql_stmt_bind_result@8'
    140. tmp/obj/release_shared/qsql_mysql.o(.text+0x738a):qsql_mysql.cpp: undefined refe
    141. rence to `mysql_stmt_bind_param@8'
    142. collect2: ld returned 1 exit status
    143. mingw32-make[1]: *** [..\..\..\..\plugins\sqldrivers\qsqlmysql4.dll] Error 1
    144. mingw32-make[1]: Leaving directory `C:/Qt/4.3.4/src/plugins/sqldrivers/mysql'
    145. mingw32-make: *** [release] Error 2
    146.  
    147. C:\Qt\4.3.4\src\plugins\sqldrivers\mysql>
    To copy to clipboard, switch view to plain text mode 

    Waiting for your reply

    Regards,

    Narasimha Raju. Naidu

  5. #25
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    4,380
    Thanks
    19
    Thanked 1,005 Times in 913 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60
    Wiki edits
    5

    Default Re: Problem Wtih Connecting MySQL Database on Windows

    Last change for me following wiki with reimp: Building the QMYSQL plugin on Windows using MinGW

    EDIT: Maybe it because libmysql.a has to be in C:\MySQL\lib not C:\MySQL\lib\opt

  6. #26
    Join Date
    Aug 2008
    Location
    Ukraine, Krivoy Rog
    Posts
    1,963
    Thanked 370 Times in 336 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Problem Wtih Connecting MySQL Database on Windows

    Quote Originally Posted by Lykurg View Post
    EDIT: Maybe it because libmysql.a has to be in C:\MySQL\lib not C:\MySQL\lib\opt
    no, libmysql.a/.lib is located in C:\MySQL\lib\opt.
    Qt Assistant -- rocks!
    please, use tags [CODE] & [/CODE].

Similar Threads

  1. Replies: 19
    Last Post: 4th April 2009, 00:17
  2. Accessing xampp mysql database
    By synack in forum Newbie
    Replies: 8
    Last Post: 19th March 2009, 10:08
  3. MySQL starting problem
    By shamik in forum General Discussion
    Replies: 5
    Last Post: 25th April 2007, 08:20
  4. Qt in windows and mysql !!!
    By probine in forum Installation and Deployment
    Replies: 13
    Last Post: 9th December 2006, 08:42
  5. Deploying with MySQL support under Windows
    By KShots in forum Installation and Deployment
    Replies: 1
    Last Post: 12th October 2006, 10:19

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.