FAQ
Hi All,

I am new to MySql++. I would like to try out the examples, however I do not
have libmysqlpp.lib or libmysqlpp_d.lib. How do I get it to build on
windows vc2008?
The documentation just says "build it".

I am looking at the files in *mysql++-3.0.7\lib *and have added them to
their own vc2008 project and I get errors like:

1>c:\p4_perforce1666_aaros2-xp\dev\aaros\dm3\simtools\externalfiles\mysql++-3.0.7\lib\type_info.cpp(58)
: warning C4273: 'types' : inconsistent dll linkage
1>
c:\p4_perforce1666_aaros2-xp\dev\aaros\dm3\simtools\externalfiles\mysql++-3.0.7\lib\type_info.h(281)
: see previous definition of 'private: static
mysqlpp::mysql_ti_sql_type_info const * const
mysqlpp::mysql_type_info::types'
1>c:\p4_perforce1666_aaros2-xp\dev\aaros\dm3\simtools\externalfiles\mysql++-3.0.7\lib\type_info.cpp(58)
: error C2491: 'mysqlpp::mysql_type_info::types' : definition of dllimport
static data member not allowed
1>c:\p4_perforce1666_aaros2-xp\dev\aaros\dm3\simtools\externalfiles\mysql++-3.0.7\lib\type_info.cpp(202)
: warning C4273: 'num_types' : inconsistent dll linkage
1>
c:\p4_perforce1666_aaros2-xp\dev\aaros\dm3\simtools\externalfiles\mysql++-3.0.7\lib\type_info.h(282)
: see previous definition of 'private: static int const
mysqlpp::mysql_type_info::num_types'


Is there a guide which I can refer to to build the static libraries?

Thanks,


--
Attila
Software Developer
atteeela@gmail.com

Search Discussions

  • Warren Young at Nov 24, 2008 at 9:38 pm

    On Nov 24, 2008, at 1:33 PM, Attila wrote:

    Is there a guide which I can refer to to build the static libraries?
    Is your program GPL'd, LGPL'd, or used only within a single
    organization? If not, you can't use static linking anyway. Read
    LICENSE.txt, which accompanied MySQL++.

    If it turns out that you're one of the few that can legitimately use
    static linking, you've probably got an inconsistent build setting
    wrong. VC++ demands that all modules use the same /M build option.

    You could change this in all of the many project files, but it's
    easier to just change the few places it occurs in mysql++.bkl and re-
    generate the project files according to README-Visual-C++.txt.
  • Attila at Nov 24, 2008 at 10:40 pm
    The program is used only within a single organization.

    I looked through the README, but it does not actually say much about
    building.
    Am I supposed to adjust parameters in the blk file and then regenerate and
    the solution files created will automatically be good?

    Thanks

    On Mon, Nov 24, 2008 at 4:38 PM, Warren Young wrote:

    On Nov 24, 2008, at 1:33 PM, Attila wrote:

    Is there a guide which I can refer to to build the static libraries?
    Is your program GPL'd, LGPL'd, or used only within a single organization?
    If not, you can't use static linking anyway. Read LICENSE.txt, which
    accompanied MySQL++.

    If it turns out that you're one of the few that can legitimately use static
    linking, you've probably got an inconsistent build setting wrong. VC++
    demands that all modules use the same /M build option.

    You could change this in all of the many project files, but it's easier to
    just change the few places it occurs in mysql++.bkl and re-generate the
    project files according to README-Visual-C++.txt.

    --
    MySQL++ Mailing List
    For list archives: http://lists.mysql.com/plusplus
    To unsubscribe:
    http://lists.mysql.com/plusplus?unsub=atteeela@gmail.com

    --
    Attila
    Software Developer
    atteeela@gmail.com
  • Warren Young at Nov 24, 2008 at 10:50 pm

    On Nov 24, 2008, at 3:40 PM, Attila wrote:

    I looked through the README, but it does not actually say much about
    building.
    Looking at the .bkl file, it seems there is no /M flags in it
    directly. They must be inferred by Bakefile. Try changing the <dll>
    tags to <lib> instead. That should do it. You might have to read the
    Bakefile docs.
    Am I supposed to adjust parameters in the blk file and then
    regenerate and
    the solution files created will automatically be good?
    That's the idea, yes. If it doesn't work for you, report what you
    changed and what symptoms you got.
  • Attila at Dec 3, 2008 at 8:36 pm
    I changed 'dll' to lib. I was able to compile mysql++ in vc2008 project.
    However in the options it generates a "Multi-threaded Debug DLL (/MDd)"
    project. I need a static lib however.

    I modified the vc2008 project to be "Multi-threaded Debug" (/MTd) instead.
    I was able to remove all errors by setting the preprocessor definition of:
    MYSQLPP_NO_DLL in the project.

    I am having some weird linking errors related to mysqlclient.lib now. The
    output of the compilation follows at the bottom.

    Compilation output:

    1>myclass.obj : warning LNK4217: locally defined symbol
    ??0Connection@mysqlpp@@QAE@_N@
    - Show quoted text -
    Z (public: __thiscall mysqlpp::Connection::Connection(bool)) imported in
    function "protected: virtual bool __thiscall shc::mediator::GUIStart(struct
    st::mediator::cmediator::INFO &)" (?GUIStart@mediator@st@
    @MAE_NAAUINFO@cmediator@mediator@st@@@Z)
    1>mysqlclient.lib(libmysql.obj) : error LNK2019: unresolved external symbol
    __db_push_ referenced in function _mysql_debug@4
    1>mysqlclient.lib(libmysql.obj) : error LNK2001: unresolved external symbol
    __no_db_
    1>mysqlclient.lib(my_fopen.obj) : error LNK2001: unresolved external symbol
    __db_on_
    1>mysqlclient.lib(mf_loadpath.obj) : error LNK2001: unresolved external
    symbol __db_on_
    1>mysqlclient.lib(my_getwd.obj) : error LNK2001: unresolved external symbol
    __db_on_
    1>mysqlclient.lib(my_lib.obj) : error LNK2001: unresolved external symbol
    __db_on_
    1>mysqlclient.lib(my_compress.obj) : error LNK2001: unresolved external
    symbol __db_on_
    1>mysqlclient.lib(mf_fn_ext.obj) : error LNK2001: unresolved external symbol
    __db_on_
    1>mysqlclient.lib(mf_pack.obj) : error LNK2001: unresolved external symbol
    __db_on_
    1>mysqlclient.lib(my_once.obj) : error LNK2001: unresolved external symbol
    __db_on_
    1>mysqlclient.lib(my_messnc.obj) : error LNK2001: unresolved external symbol
    __db_on_
    1>mysqlclient.lib(mf_dirname.obj) : error LNK2001: unresolved external
    symbol __db_on_
    1>mysqlclient.lib(my_error.obj) : error LNK2001: unresolved external symbol
    __db_on_
    1>mysqlclient.lib(viossl.obj) : error LNK2001: unresolved external symbol
    __db_on_
    1>mysqlclient.lib(viosslfactories.obj) : error LNK2001: unresolved external
    symbol __db_on_
    1>mysqlclient.lib(my_winthread.obj) : error LNK2001: unresolved external
    symbol __db_on_
    1>mysqlclient.lib(my_time.obj) : error LNK2001: unresolved external symbol
    __db_on_
    1>mysqlclient.lib(viosocket.obj) : error LNK2001: unresolved external symbol
    __db_on_
    1>mysqlclient.lib(typelib.obj) : error LNK2001: unresolved external symbol
    __db_on_
    1>mysqlclient.lib(array.obj) : error LNK2001: unresolved external symbol
    __db_on_
    1>mysqlclient.lib(mf_format.obj) : error LNK2001: unresolved external symbol
    __db_on_
    1>mysqlclient.lib(my_read.obj) : error LNK2001: unresolved external symbol
    __db_on_
    1>mysqlclient.lib(list.obj) : error LNK2001: unresolved external symbol
    __db_on_
    1>mysqlclient.lib(my_alloc.obj) : error LNK2001: unresolved external symbol
    __db_on_
    1>mysqlclient.lib(vio.obj) : error LNK2001: unresolved external symbol
    __db_on_
    1>mysqlclient.lib(net_serv.obj) : error LNK2001: unresolved external symbol
    __db_on_
    1>mysqlclient.lib(safemalloc.obj) : error LNK2001: unresolved external
    symbol __db_on_
    1>mysqlclient.lib(my_open.obj) : error LNK2001: unresolved external symbol
    __db_on_
    1>mysqlclient.lib(libmysql.obj) : error LNK2001: unresolved external symbol
    __db_on_
    1>mysqlclient.lib(client.obj) : error LNK2019: unresolved external symbol
    __db_on_ referenced in function _free_old_query
    1>mysqlclient.lib(my_init.obj) : error LNK2001: unresolved external symbol
    __db_on_
    1>mysqlclient.lib(charset.obj) : error LNK2001: unresolved external symbol
    __db_on_
    1>mysqlclient.lib(my_fopen.obj) : error LNK2001: unresolved external symbol
    __db_doprnt_
    1>mysqlclient.lib(mf_loadpath.obj) : error LNK2001: unresolved external
    symbol __db_doprnt_
    1>mysqlclient.lib(my_getwd.obj) : error LNK2001: unresolved external symbol
    __db_doprnt_
    1>mysqlclient.lib(my_lib.obj) : error LNK2001: unresolved external symbol
    __db_doprnt_
    1>mysqlclient.lib(my_compress.obj) : error LNK2001: unresolved external
    symbol __db_doprnt_
    1>mysqlclient.lib(mf_fn_ext.obj) : error LNK2001: unresolved external symbol
    __db_doprnt_
    1>mysqlclient.lib(mf_pack.obj) : error LNK2001: unresolved external symbol
    __db_doprnt_
    1>mysqlclient.lib(my_once.obj) : error LNK2001: unresolved external symbol
    __db_doprnt_
    1>mysqlclient.lib(my_messnc.obj) : error LNK2001: unresolved external symbol
    __db_doprnt_
    1>mysqlclient.lib(mf_dirname.obj) : error LNK2001: unresolved external
    symbol __db_doprnt_
    1>mysqlclient.lib(my_error.obj) : error LNK2001: unresolved external symbol
    __db_doprnt_
    1>mysqlclient.lib(viossl.obj) : error LNK2001: unresolved external symbol
    __db_doprnt_
    1>mysqlclient.lib(viosslfactories.obj) : error LNK2001: unresolved external
    symbol __db_doprnt_
    1>mysqlclient.lib(my_winthread.obj) : error LNK2001: unresolved external
    symbol __db_doprnt_
    1>mysqlclient.lib(my_time.obj) : error LNK2001: unresolved external symbol
    __db_doprnt_
    1>mysqlclient.lib(viosocket.obj) : error LNK2001: unresolved external symbol
    __db_doprnt_
    1>mysqlclient.lib(typelib.obj) : error LNK2001: unresolved external symbol
    __db_doprnt_
    1>mysqlclient.lib(array.obj) : error LNK2001: unresolved external symbol
    __db_doprnt_
    1>mysqlclient.lib(mf_format.obj) : error LNK2001: unresolved external symbol
    __db_doprnt_

    On Mon, Nov 24, 2008 at 5:50 PM, Warren Young wrote:

    On Nov 24, 2008, at 3:40 PM, Attila wrote:

    I looked through the README, but it does not actually say much about
    building.
    Looking at the .bkl file, it seems there is no /M flags in it directly.
    They must be inferred by Bakefile. Try changing the <dll> tags to <lib>
    instead. That should do it. You might have to read the Bakefile docs.

    Am I supposed to adjust parameters in the blk file and then regenerate and
    the solution files created will automatically be good?
    That's the idea, yes. If it doesn't work for you, report what you changed
    and what symptoms you got.


    --
    MySQL++ Mailing List
    For list archives: http://lists.mysql.com/plusplus
    To unsubscribe:
    http://lists.mysql.com/plusplus?unsub=atteeela@gmail.com

    --
    Attila
    Software Developer
    atteeela@gmail.com
  • Warren Young at Dec 3, 2008 at 10:32 pm

    Attila wrote:
    I changed 'dll' to lib. I was able to compile mysql++ in vc2008 project.
    However in the options it generates a "Multi-threaded Debug DLL (/MDd)"
    project. I need a static lib however.
    Actually, I don't see a reason to change the /M options. They affect
    which run-time library your program links to, not how the program or
    library itself gets built. You should be able to have a static MySQL++
    library that links dynamically to the VC++ standard libraries.
    I am having some weird linking errors related to mysqlclient.lib now.
    This is due to using a different /M option than was used to build that
    library. You can't mix /M options among modules in a program.

    If you had to have a fully static link, you'd have to rebuild
    mysqlclient.lib from source, too.

    P.S. Please don't send email to me directly. I do read the list.
    Multiple copies of the same message do nothing but annoy me.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupplusplus @
categoriesmysql
postedNov 24, '08 at 8:33p
activeDec 3, '08 at 10:32p
posts6
users2
websitemysql.com
irc#mysql

2 users in discussion

Attila: 3 posts Warren Young: 3 posts

People

Translate

site design / logo © 2022 Grokbase