List:MySQL++« Previous MessageNext Message »
From:lee Date:January 11 2010 10:05am
Subject:Why cant I define more than two sql_create_# macro?
View as plain text  
    Here is the problems:
    I want to define two ssql in one .h file, like this:
 #ifndef MYCC_H
#define MYCC_H
#include <mysql++/mysql++.h>
#include <mysql++/ssqls.h>

                         mysqlpp::sql_text,    s1,
                         mysqlpp::sql_text,    s2);

                         mysqlpp::sql_int,     id,
                         mysqlpp::sql_varchar, usr,
                         mysqlpp::sql_text,    text,
                        mysqlpp::sql_varchar, s1,
                         mysqlpp::sql_varchar, s2);
//than here is another source...
but  when I complier this file, it give me some link error like this:
mycc.o: In function `table1::table() const':
/usr/include/c++/4.2/bits/ios_base.h:629: undefined reference to `table1::table_'
mycc.o: In function `std::basic_ostream<char, std::char_traits<char> >&
operator<< <mysqlpp::do_nothing_type0>(std::basic_ostream<char,
std::char_traits<char> >&,
table1_field_list<mysqlpp::do_nothing_type0> const&)':
/test/mycc.h:11: undefined reference to `table1::names'
/test/mycc.h:11: undefined reference to `table1::names'
I have alread define the MYSQLPP_SSQLS_NO_STATICS macro, but it still link error. 
BUT....if only call sql_create_5(table2......)   it won't cause this  problem,  and it
works right.(means I don't define table1)
so, I request some help, thanks very much....
Why cant I define more than two sql_create_# macro?lee11 Jan
  • Re: Why cant I define more than two sql_create_# macro?Warren Young11 Jan