EXE stops working after compile. (Mysql C++ Connector) -
im using code::blocks 13.12 mingw 4.8.1 on windows 8. tried link mysql c++ connector 1.1.4 in dynamic , static way. when compiling doesn't give error, when starting exe stops working.
i tried next code:
#include <iostream> #include "mysql_connection.h" #include "cppconn/driver.h" using namespace sql; int main() { driver *driver; connection * con; std::cout << "1\n"; driver = get_driver_instance(); std::cout << "2\n"; con = driver->connect("tcp://127.0.0.1:3306", "test", "test"); std::cout << "3\n"; homecoming 0; } building doesn't give error:
class="lang-none prettyprint-override">-------------- build: debug in mysql_connect (compiler: gnu gcc compiler)--------------- mingw32-g++.exe -fexceptions -g -dcppconn_public_func= -id:\development\libraries\boost_1_56_0 -c d:\development\projects\codeblocks\mysql_connect\main.cpp -o obj\debug\main.o mingw32-g++.exe -ld:\development\libraries\boost_1_56_0 -o bin\debug\mysql_connect.exe obj\debug\main.o "c:\program files (x86)\mysql\connector.c++ 1.1\lib\opt\mysqlcppconn.lib" output file bin\debug\mysql_connect.exe size 66.01 kb process terminated status 0 (0 minute(s), 1 second(s)) 0 error(s), 0 warning(s) (0 minute(s), 1 second(s)) here log given gdb:
starting debugger: d:\development\compiler\mingw\bin\gdb.exe -nx -fullname -quiet -args d:/development/projects/codeblocks/mysql_connect/bin/debug/mysql_connect.exe done registered new type: wxstring registered new type: stl string registered new type: stl vector setting breakpoints debugger name , version: gnu gdb (gdb) 7.6.1 kid process pid: 4236 in raiseexception () (c:\windows\syswow64\kernelbase.dll) #13 0x00401468 in _fu1___zst4cout () @ d:\development\projects\codeblocks\mysql_connect\main.cpp:13 d:\development\projects\codeblocks\mysql_connect\main.cpp:13:252:beg:0x401468 @ d:\development\projects\codeblocks\mysql_connect\main.cpp:13 continuing... [inferior 1 (process 4236) exited code 0377] debugger finished status 0 1 , 2 printed on console, 3 not. process returned 255 (0xff).
the programme fails @ line:
con = driver->connect("tcp://127.0.0.1:3306", "test", "test"); could help work?
con = driver->connect("tcp:://127.0.0.1:3306", "test", "test");
you have above 1 , mysql website has below code.
con = driver->connect("tcp://127.0.0.1:3306", "root", "root"); i don't see much difference. sure username,password , port same mentioned in code?
c++ mysql codeblocks mysql-connector
No comments:
Post a Comment