Author Topic: Can't use mySQL Connector C++  (Read 4895 times)

Offline Malorbian

  • Single posting newcomer
  • *
  • Posts: 3
Can't use mySQL Connector C++
« on: April 07, 2016, 12:07:16 pm »
Hi,
I tried to use the Connector/C++ 1.1.7 with C::B 16:01 and the included Compiler MinGW. Of cause it failed - the precompiled binary requires the Compiler of Microsoft Visual Studio 2013. C::B 16.01 just offers the usage of the Compiler for Microsoft Visual C++ 2010 (or older versions). I installed Visual Studio Community 2015 but there is no compiler named d.exe.
Do I have to compile the Connector from the source ?
What compiler has to be used ?
Does anybody have a little guidance / howto for using the Connector/C++ 1.1.7 with C::B 16.01 ?

Thanks for answers !

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7591
    • My Best Post
Re: Can't use mySQL Connector C++
« Reply #1 on: April 07, 2016, 11:01:34 pm »
Hi,
I tried to use the Connector/C++ 1.1.7 with C::B 16:01 and the included Compiler MinGW. Of cause it failed - the precompiled binary requires the Compiler of Microsoft Visual Studio 2013. C::B 16.01 just offers the usage of the Compiler for Microsoft Visual C++ 2010 (or older versions). I installed Visual Studio Community 2015 but there is no compiler named d.exe.
Do I have to compile the Connector from the source ?
What compiler has to be used ?
Does anybody have a little guidance / howto for using the Connector/C++ 1.1.7 with C::B 16.01 ?

Thanks for answers !

The name of the MSVC++ compiler is CL not D and therefore the lower case name is cl.exe

Please read this site rules http://forums.codeblocks.org/index.php/topic,9996.0.html
I have no idea if your question is inside or outside the rules.

I spent 5 minutes on Google and got this link; NOTE: it is most likely beyond your ability to use; since, you likely will need to use Google to find out what is missing in the directions.
http://forums.mysql.com/read.php?117,425191,425191#msg-425191

FYI: If you plan to be a programmer; the top skill is learning to find the answer using a web search engine like Google.

Tim S.
« Last Edit: April 08, 2016, 12:25:45 am by stahta01 »
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7591
    • My Best Post
Re: Can't use mySQL Connector C++
« Reply #2 on: April 09, 2016, 09:43:12 pm »
Your PM to me added no real info; so, I hope you get help somewhere.
Because you appeared to be very confused. I suggest reading the FAQs.
Because I have no idea why you think "d.exe" is a C or C++ compiler in Code::Blocks.

Tim S.
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline Malorbian

  • Single posting newcomer
  • *
  • Posts: 3
Re: Can't use mySQL Connector C++
« Reply #3 on: April 26, 2016, 10:32:25 am »
Hi,
you're right of cause ! I ordered new glasses ::). My flimsy excuse: if you glance at the config info written in a sans serif font, you can fail by combining c and l to d.
In the meantime I analysed the source code of the connector a little bit and found a few changes to let MinGW compile it without errors. Now my "last" problem is that the linker don't like the precompiled libraries (libmysqlclient.lib, libmysql.lib) - precompiled obviously with Visual Studio 2013. This is what I see when reading this error log - but may be it's wrong and I still need the new glasses:
...
[ 14%] Linking CXX shared library libmysqlcppconn.dll
cd /d C:\temp\dest\driver && C:\temp\cmake\bin\cmake.exe -E cmake_link_script CMakeFiles\mysqlcppconn.dir\link.txt --verbose=1
C:\temp\cmake\bin\cmake.exe -E remove -f CMakeFiles\mysqlcppconn.dir/objects.a
C:\PROGRA~2\CODEBL~1.01\MinGW\bin\ar.exe cr CMakeFiles\mysqlcppconn.dir/objects.a @CMakeFiles\mysqlcppconn.dir\objects1.rsp
C:\PROGRA~2\CODEBL~1.01\MinGW\bin\G__~1.EXE   -O3 -DNDEBUG   -shared -o libmysqlcppconn.dll -Wl,--out-implib,libmysqlcppconn.dll.a -Wl,--major-image-version,7,--minor-image-version,1 -Wl,--whole-archive CMakeFiles\mysqlcppconn.dir/objects.a -Wl,--no-whole-archive @CMakeFiles\mysqlcppconn.dir\linklibs.rsp
CMakeFiles\mysqlcppconn.dir/objects.a(mysql_client_api.cpp.obj):mysql_client_api.cpp:(.text+0x17d): undefined reference to `mysql_server_end@0'
CMakeFiles\mysqlcppconn.dir/objects.a(mysql_client_api.cpp.obj):mysql_client_api.cpp:(.text+0x3cb): undefined reference to `mysql_stmt_free_result@4'
CMakeFiles\mysqlcppconn.dir/objects.a(mysql_client_api.cpp.obj):mysql_client_api.cpp:(.text+0x45d): undefined reference to `mysql_server_end@0'
CMakeFiles\mysqlcppconn.dir/objects.a(mysql_client_api.cpp.obj):mysql_client_api.cpp:(.text+0x52c): undefined reference to `mysql_server_init@12'
CMakeFiles\mysqlcppconn.dir/objects.a(mysql_client_api.cpp.obj):mysql_client_api.cpp:(.text+0x5ca): undefined reference to `mysql_server_end@0'
CMakeFiles\mysqlcppconn.dir/objects.a(mysql_client_api.cpp.obj):mysql_client_api.cpp:(.text+0x67d): undefined reference to `mysql_options@12'
CMakeFiles\mysqlcppconn.dir/objects.a(mysql_client_api.cpp.obj):mysql_client_api.cpp:(.text+0x754): undefined reference to `mysql_options4@16'
CMakeFiles\mysqlcppconn.dir/objects.a(mysql_client_api.cpp.obj):mysql_client_api.cpp:(.text+0x82d): undefined reference to `mysql_get_option@12'
...
Is it on principle possible to enable the MinGW-Linker to use these libraries or is this really a dead end ?

Chris