MySQL/C++ SQLString.h missing
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5

Thread: MySQL/C++ SQLString.h missing

  1. #1
    Join Date
    Jan 2012
    Posts
    12

    MySQL/C++ SQLString.h missing

    Hi,

    I am trying to get the MySQL C++ connector to work. I understand that the SQLString.h library has been missed out of the package as stated in the forum:

    http://forums.mysql.com/read.php?167,387820,415344

    and I have downloaded it from one of the zip packages as suggested. i am only writing a very basic test code. I now get the following errors instead...

    ///////////////////////////////////////////////////////////////////////////
    1>------ Build started: Project: SQL_test, Configuration: Debug Win32 ------

    1>Build started 31/01/2012 17:38:44.

    1>InitializeBuildStatus:

    1> Touching "Debug\SQL_test.unsuccessfulbuild".

    1>ClCompile:

    1> SQL_test.cpp

    1>c:\documents and settings\mmtl\my documents\visual studio 2010\projects\mysql\sql_test\sql_test\include\cppconn\sqlstring.h(36): warning C4251: 'sql::SQLString::realStr' : class 'std::basic_string<_Elem,_Traits,_Ax>' needs to have dll-interface to be used by clients of class 'sql::SQLString'

    1> with

    1> [

    1> _Elem=char,

    1> _Traits=std::char_traits<char>,

    1> _Ax=std::allocator<char>

    1> ]

    1>c:\documents and settings\mmtl\my documents\visual studio 2010\projects\mysql\sql_test\sql_test\mysql_connection.h(156): warning C4251: 'sql::mysql::MySQL_Connection:roxy' : class 'boost::shared_ptr<T>' needs to have dll-interface to be used by clients of class 'sql::mysql::MySQL_Connection'

    1> with

    1> [

    1> T=sql::mysql::NativeAPI::NativeConnectionWrapper

    1> ]

    1>c:\documents and settings\mmtl\my documents\visual studio 2010\projects\mysql\sql_test\sql_test\include\cppconn\exception.h(59): warning C4251: 'sql::SQLException::sql_state' : class 'std::basic_string<_Elem,_Traits,_Ax>' needs to have dll-interface to be used by clients of class 'sql::SQLException'

    1> with

    1> [

    1> _Elem=char,

    1> _Traits=std::char_traits<char>,

    1> _Ax=std::allocator<char>

    1> ]

    1>c:\documents and settings\mmtl\my documents\visual studio 2010\projects\mysql\sql_test\sql_test\include\cppconn\config.h(60): error C2371: 'int8_t' : redefinition; different basic types

    1> c:\program files\microsoft visual studio 10.0\vc\include\stdint.h(17) : see declaration of 'int8_t'

    1>c:\documents and settings\mmtl\my documents\visual studio 2010\projects\mysql\sql_test\sql_test\include\cppconn\config.h(60): error C2371: 'int8_t' : redefinition; different basic types

    1> c:\program files\microsoft visual studio 10.0\vc\include\stdint.h(17) : see declaration of 'int8_t'

    1>

    1>Build FAILED.

    1>

    1>Time Elapsed 00:00:05.98

    ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
    /////////////////////////////////////////////////////////////////////////////

    I see that a couple of people have posted this before on different forums but I haven't managed to find any responses. I would really appreciate any help that anybody could give me. I am a beginner so please be patient with me!

    Thank you for any help you can give!

  2. #2
    Join Date
    Apr 1999
    Posts
    27,430

    Re: MySQL/C++ SQLString.h missing

    c:\documents and settings\mmtl\my documents\visual studio 2010\projects\mysql\sql_test\sql_test\include\cppconn\config.h(60): error C2371: 'int8_t' : redefinition; different basic types
    That config.h header is defining a type called int8_t.

    Then you have this:
    1> c:\program files\microsoft visual studio 10.0\vc\include\stdint.h(17) : see declaration of 'int8_t'
    There is another int8_t defined in stdint.h. So which int8_t is supposed to be used?

    That is what the compiler is telling you -- the module you're compiling is including headers that have contradicting definitions of int8_t.
    Quote Originally Posted by CodeCheck View Post
    and I have downloaded it from one of the zip packages as suggested. i am only writing a very basic test code. I now get the following errors instead...
    Well, this "basic test code" is flawed, as you're including two headers that have conflicting definitions of int8_t. That config.h file isn't right, as it is trying to change what stdint.h has already defined.

    Regards,

    Paul McKenzie

  3. #3
    Join Date
    Jan 2012
    Posts
    12

    Re: MySQL/C++ SQLString.h missing

    Thank you for explaning this to me. However it now leaves me stuck as to how I am meant to connect C++ to MySQL...

  4. #4
    Join Date
    Apr 1999
    Posts
    27,430

    Re: MySQL/C++ SQLString.h missing

    Quote Originally Posted by CodeCheck View Post
    Thank you for explaning this to me. However it now leaves me stuck as to how I am meant to connect C++ to MySQL...
    It's not just a matter of getting a missing header file. You must make sure that you have set any required preprocessor symbols before you compile anything.

    More than likely, that header file you received requires you to do something in advance that allows it to be used in a Visual C++ program. Usually there are preprocessor switches that you must set so that the source code doesn't take the wrong path of defining things that the compiler's headers have already defined.

    In this case, the header believes that there is no stdint.h defined by your compiler, so defines its own version of int8_t. If you open that header, you will probably see #ifdef and #defines that makes sure that int8_t is defined only if a certain #define switch is set (or not set).

    Regards,

    Paul McKenzie

  5. #5
    Join Date
    Jan 2012
    Posts
    12

    Re: MySQL/C++ SQLString.h missing

    Thanks. In the ended I downloaded a different connector (SQLAPI++) and have got it connecting with that. Thank you for your help

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This is a CodeGuru survey question.


Featured


HTML5 Development Center