How to make handler plugin to mysql in CentOS - mysql

Environment: CentOS+mysql-5.6.14
This is what I tried:
cd /usr/local/src/
tar zvfx ahiguti-HandlerSocket-Plugin-for-MySQL-1.0.6-71-g159ea6d.tar.gz
cd ahiguti-HandlerSocket-Plugin-for-MySQL-159ea6d/
./autogen.sh
./configure --with-mysql-source=/usr/local/src/mysql-5.1.47 --with-mysql-bindir=/usr/local/app/mysql/bin/ --with-mysql-plugindir=/usr/local/app/mysql/lib/mysql/plugin/ --prefix=/usr/local/app/mysql
make
but when i do 'make', I encounter the following errors:
In file included from database.cpp:16:
mysql_incl.hpp:12:1: warning: "HAVE_CONFIG_H" redefined
<command line>:1:1: warning: this is the location of the previous definition
database.cpp: In member function 'virtual void dena::dbcontext::init_thread(const void*, volatile int&)':
database.cpp:294: error: 'LOCK_thread_count' was not declared in this scope
database.cpp:296: error: 'threads' was not declared in this scope
database.cpp:297: error: 'thread_count' was not declared in this scope
database.cpp:310: error: 'create' is not a member of 'MDL_request'
database.cpp: In member function 'virtual void dena::dbcontext::term_thread()':
database.cpp:337: error: 'LOCK_thread_count' was not declared in this scope
database.cpp:340: error: 'thread_count' was not declared in this scope
database.cpp: In member function 'void dena::dbcontext::cmd_find_internal(dena::dbcallback_i&, const dena::prep_stmt&, ha_rkey_function, const dena::cmd_exec_args&)':
database.cpp:649: error: 'struct st_key' has no member named 'key_parts'
/data/install/mysql-5.6.14/sql/handler.h:2228: error: 'virtual int handler::index_read_map(uchar*, const uchar*, key_part_map, ha_rkey_function)' is protected
database.cpp:689: error: within this context
/data/install/mysql-5.6.14/sql/handler.h:2247: error: 'virtual int handler::index_prev(uchar*)' is protected
database.cpp:694: error: within this context
/data/install/mysql-5.6.14/sql/handler.h:2244: error: 'virtual int handler::index_next(uchar*)' is protected
database.cpp:698: error: within this context
/data/install/mysql-5.6.14/sql/handler.h:2256: error: 'virtual int handler::index_next_same(uchar*, const uchar*, uint)' is protected
database.cpp:701: error: within this context
database.cpp: In member function 'virtual void dena::dbcontext::cmd_open_index(dena::dbcallback_i&, size_t, const char*, const char*, const char*, const char*)':
database.cpp:770: error: cannot convert 'MEM_ROOT*' to 'Open_table_context*' for argument '3' to 'bool open_table(THD*, TABLE_LIST*, Open_table_context*)'
make[2]: *** [handlersocket_la-database.lo] error 1
make[1]: Leaving directory `/usr/local/src/HandlerSocket-Plugin-for-MySQL-1.0.6'
make: *** [all] error 2

You should use version 1.1 of https://github.com/DeNA/HandlerSocket-Plugin-for-MySQL

Related

undefined reference to symbol '_ZN12QSqlDatabase11setHostNameERK7QString'

My program has a basic function for adding datas to database but when the code gives an error when it is compiled.
void MainWindow::AddLocationToDatabase()
{
QSqlDatabase db= QSqlDatabase::addDatabase("QMYSQL");
db.setHostName("localhost");
db.setUserName("root");
db.setPassword("*******");
db.setDatabaseName("databasename");
db.setPort(1111);
if(db.open()){
qDebug()<<"connected";
}
}
/usr/bin/ld: build/debug/mainwindow.o: undefined reference to symbol '_ZN12QSqlDatabase11setHostNameERK7QString'
/usr/lib/x86_64-linux-gnu/libQt5Sql.so.5: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
make: *** [sub-pcapprogram-make_first-ordered] Error 2
06:57:04: The process "/usr/bin/make" exited with code 2.
When executing step "Make"
When I added "QT += sql", there was no error.

ebtables.c:61:3: error: implicit declaration of function 'xt_compat_calc_jump' [-Werror=implicit-function-declaration]

I am getting the following exception while building the recovery for a lineageos project and need some help diagnosing and resolving the issue
Device tree:= https://github.com/darran-kelinske-fivestars/android_device_lenovo_tb8504f/tree/lineage-15.1
Vendor tree:= https://github.com/darran-kelinske-fivestars/android_vendor_lenovo_tb8504f/tree/lineage-15.1
Kernel source:= https://github.com/darran-kelinske-fivestars/android_kernel_lenovo_tb8504f/tree/lineage-15.1
ROM Source:= https://github.com/LineageOS/android
Command: source build/envsetup.sh && breakfast tb8504f && repo sync --force-sync -q -j6 && mka recoveryimage -j6 | tee recovery.log
../../../../../../kernel/lenovo/msm8917/net/bridge/netfilter/ebtables.c: In function 'ebt_standard_compat_from_user':
../../../../../../kernel/lenovo/msm8917/net/bridge/netfilter/ebtables.c:61:3: error: implicit declaration of function 'xt_compat_calc_jump' [-Werror=implicit-function-declaration]
v += xt_compat_calc_jump(NFPROTO_BRIDGE, v);
^
../../../../../../kernel/lenovo/msm8917/net/bridge/netfilter/ebtables.c: At top level:
../../../../../../kernel/lenovo/msm8917/net/bridge/netfilter/ebtables.c:76:15: error: variable 'ebt_standard_target' has initializer but incomplete type
static struct xt_target ebt_standard_target = {
^
../../../../../../kernel/lenovo/msm8917/net/bridge/netfilter/ebtables.c:77:2: error: unknown field 'name' specified in initializer
.name = "standard",
^
../../../../../../kernel/lenovo/msm8917/net/bridge/netfilter/ebtables.c:77:2: warning: excess elements in struct initializer
error, forbidden warning: ebtables.c:77
CC net/core/gen_estimator.o
/home/lineageos/kernel/lenovo/msm8917/scripts/Makefile.build:257: recipe for target 'net/bridge/netfilter/ebtables.o' failed
make[4]: *** [net/bridge/netfilter/ebtables.o] Error 1
/home/lineageos/kernel/lenovo/msm8917/scripts/Makefile.build:402: recipe for target 'net/bridge/netfilter' failed
make[3]: *** [net/bridge/netfilter] Error 2
/home/lineageos/kernel/lenovo/msm8917/scripts/Makefile.build:402: recipe for target 'net/bridge' failed
make[2]: *** [net/bridge] Error 2
make[2]: *** Waiting for unfinished jobs....
Full log:
https://pastebin.com/v2ZsfRuc
I resolved this issue by replacing the source in the include directory of this project with the include directory of another project.
I replaced the source with the source from this directory:
https://github.com/HighwayStar/android_kernel_lenovo_tb8704/tree/tab4-8plus-LA.UM.5.6.r1-0/include

RESTful - CodeIgniter 3.1.5 - Fatal Error, Call to undefined function factory

I'm trying to make "RESTful" using CodeIgniter 3.1.5 and libraries https://github.com/chriskacerguis/codeigniter-restserver
I get this error:
Fatal error: Call to undefined factory function () in D:\AppServ\www\restful\application\libraries\REST_Controller.php on line 857
A PHP Error was encountered
Severity: Error
Message: Call to undefined function factory ()
Filename: libraries/REST_Controller.php
Line Number: 857
Backtrace:
(Not my code, but it is example from codeigniter-restserver)
enter in line 61 of autoload.php
$autoload['libraries'] = array('database','Format');
I solved it that way.

Cannot compile MySQL++

I am trying to compile MySQL++ 3.1.0 with the command:
mingw32-make -f Makefile.mingw
After a set of files gets compiled (e.g. beemutex.cpp, cmdline.cpp, connection.cpp, ...), I get these errors:
g++ -c -o mysqlpp_sql_buffer.o -g -mthreads -DUNICODE -D_UNICODE -DMYSQLPP_NO_DLL -DHAVE_MYSQL_SSL_SET -I"C:\Program Files\MySQL\MySQL Server 5.5\include" -MT
mysqlpp_sql_buffer.o -MFmysqlpp_sql_buffer.o.d -MD -MP lib/sql_buffer.cpp
In file included from lib/sql_buffer.h:31:0,
from lib/sql_buffer.cpp:26:
lib/refcounted.h:258:2: error: 'size_t' does not name a type
lib/refcounted.h: In constructor 'mysqlpp::RefCountedPointer<T, Destroyer>::RefCountedPointer()':
lib/refcounted.h:89:2: error: class 'mysqlpp::RefCountedPointer<T, Destroyer>' does not have any field named 'refs_'
lib/refcounted.h: In constructor 'mysqlpp::RefCountedPointer<T, Destroyer>::RefCountedPointer(T*)':
lib/refcounted.h:100:2: error: class 'mysqlpp::RefCountedPointer<T, Destroyer>' does not have any field named 'refs_'
lib/refcounted.h:104:4: error: 'refs_' was not declared in this scope
lib/refcounted.h:104:16: error: expected type-specifier before 'size_t'
lib/refcounted.h:104:16: error: expected ';' before 'size_t'
lib/refcounted.h: In constructor 'mysqlpp::RefCountedPointer<T, Destroyer>::RefCountedPointer(const ThisType&)':
lib/refcounted.h:112:2: error: class 'mysqlpp::RefCountedPointer<T, Destroyer>' does not have any field named 'refs_'
lib/refcounted.h:115:8: error: 'refs_' was not declared in this scope
lib/refcounted.h: In destructor 'mysqlpp::RefCountedPointer<T, Destroyer>::~RefCountedPointer()':
lib/refcounted.h:125:7: error: 'refs_' was not declared in this scope
lib/refcounted.h: In member function 'void mysqlpp::RefCountedPointer<T, Destroyer>::swap(mysqlpp::RefCountedPointer<T, Destroyer>::ThisType&)':
lib/refcounted.h:246:13: error: 'refs_' was not declared in this scope
mingw32-make: *** [mysqlpp_sql_buffer.o] Error 1
Something could be wrong in my configuration, but I can't find what. It seems strange that it cannot find, e.g., size_t.
Thank you!
Platform:
Windows 7
MinGW 2011.09 / GCC 4.6.1
MySQL 5.5
mysql++ 3.1.0
Changing size_t() with std::size_t() in refcounted.h solved the problem. It now compiles.
I still have linking problems, but they should be different issues.

Weird error compiling code that calls Surface low-level CUDA API

This minimal example:
int main()
{
struct surfaceReference* surfaceReferencePointer;
cudaGetSurfaceReference(&surfaceReferencePointer, "surfaceReference");
}
Fails when it is compiled like this:
nvcc -g -arch=sm_20 -o foo.out foo.cu
Showing the following error message:
foo.cu(4): warning: argument of type "surfaceReference **" is incompatible with parameter of type "const surfaceReference **"
foo.cu(4): warning: argument of type "surfaceReference **" is incompatible with parameter of type "const surfaceReference **"
foo.cu: In function ‘int main()’:
foo.cu:4: error: invalid conversion from ‘surfaceReference**’ to ‘const surfaceReference**’
foo.cu:4: error: initializing argument 1 of ‘cudaError_t cudaGetSurfaceReference(const surfaceReference**, const char*)’
I cannot understand what I am doing wrong. I am compiling on a Linux Ubuntu 64-bit machine, using CUDA 3.2.
The struct surfaceReference* pointer should be defined as const:
int main()
{
const struct surfaceReference* surfaceReferencePointer;
cudaGetSurfaceReference(&surfaceReferencePointer, "surfaceReference");
}
Kudos to codymanix, who provided the right answer in the comments.