Uri Even-Chen writes:
> MySQL license: #7259
> MySQL basic email support: #489
> -------------------------------
> hi.
>
> I have so many problems in compiling my programs with mysql++. I have
> already installed mySQL and mysql++, but I didn't find information on
> how to compile files with it. I keep getting compilation errors, even
> after I added all the include library options -I, -L and -l. I'm not
> using any Makefile, but I compile everything from a script. I even can't
> compile your examples. my compilation command is (I tried every possible
> option):
>
> `/usr/bin/g++ -L/usr/lib/mysql -lmysqlclient -lmysql++ -I
> /usr/local/include/mysql++/ -I /usr/include/mysql/ simple1.cc`
>
> and the result is:
>
> /tmp/cc6w86cv.o: In function `MysqlRes::data_seek(unsigned int) const':
> /tmp/cc6w86cv.o(.MysqlRes::gnu.linkonce.t.data_seek(unsigned int)
> const+0x11): undefined reference to `mysql_data_seek'
> /tmp/cc6w86cv.o: In function `MysqlRes::fetch_row(void) const':
> /tmp/cc6w86cv.o(.MysqlRes::gnu.linkonce.t.fetch_row(void) const+0x18):
> undefined reference to `mysql_fetch_lengths'
> /tmp/cc6w86cv.o(.MysqlRes::gnu.linkonce.t.fetch_row(void) const+0x28):
> undefined reference to `mysql_fetch_row'
> /usr/local/lib/libmysql++.so: undefined reference to
> `mysql_store_result'
> /usr/local/lib/libmysql++.so: undefined reference to `mysql_init'
> /usr/local/lib/libmysql++.so: undefined reference to `mysql_connect'
> /usr/local/lib/libmysql++.so: undefined reference to `mysql_shutdown'
> /usr/local/lib/libmysql++.so: undefined reference to `mysql_refresh'
> /usr/local/lib/libmysql++.so: undefined reference to `mysql_select_db'
> /usr/local/lib/libmysql++.so: undefined reference to
> `mysql_escape_string'
> /usr/local/lib/libmysql++.so: undefined reference to `mysql_close'
> /usr/local/lib/libmysql++.so: undefined reference to `mysql_fetch_field'
> /usr/local/lib/libmysql++.so: undefined reference to `mysql_free_result'
> /usr/local/lib/libmysql++.so: undefined reference to `mysql_use_result'
> /usr/local/lib/libmysql++.so: undefined reference to `mysql_query'
> /usr/local/lib/libmysql++.so: undefined reference to `mysql_field_seek'
> collect2: ld returned 1 exit status
>
>
> it's very frustrating, and I've been trying to solve this problem for
> hours. I will appreciate your help.
>
> Uri.
Hi!
All that you are missing is -L pointing to the location where
libmysqlclient.a or .so is !!
That is all .
Regards,
Sinisa
+----------------------------------------------------------------------+
| TcX ____ __ _____ _____ ___ == mysql@stripped |
| /*/\*\/\*\ /*/ \*\ /*/ \*\ |*| Sinisa Milivojevic |
| /*/ /*/ /*/ \*\_ |*| |*||*| mailto:sinisa@stripped |
| /*/ /*/ /*/\*\/*/ \*\|*| |*||*| Larnaka, Cyprus |
| /*/ /*/ /*/\*\_/*/ \*\_/*/ |*|____ |
| ^^^^^^^^^^^^/*/^^^^^^^^^^^\*\^^^^^^^^^^^ |
| /*/ \*\ Developers Team |
+----------------------------------------------------------------------+