MySQL Forums
Forum List  »  Connector/C++

Using mysql Connector/C++ in a dll problem
Posted by: Maurice Tadros
Date: October 30, 2009 08:57PM

Hello

I have successfully used Connector/C++ as a static library and dynamic library in a command line console.

I have a need to compile this as a dll. I can get it to compile but when the external program calls it the dll does not behave in the same manner. The program does run when I include all the libraries and with this code.

sql::Driver *driver;
sql::Connection *con;
sql::Statement *stmt;

// driver = get_driver_instance();


When I uncomment the driver code out it does not work. I have tried using Connector/C++ as a static and dynamic library. Also if I call an unrealted function it does not work if the driver code is uncommented.

Ie
char* test1(){
return “test1”;
}

void test2(){
sql::Driver *driver;
sql::Connection *con;
sql::Statement *stmt;

driver = get_driver_instance();

}

If I call test1 it will not work unless the driver code is commented out.

I am not sure how to debug this problem futher or what my nexts steps should be.

Please give me some suggests or if you need additional information I will be happy to provide it.

Cheers,
Maurice

Options: ReplyQuote


Subject
Views
Written By
Posted
Using mysql Connector/C++ in a dll problem
4255
October 30, 2009 08:57PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.