List:MySQL++« Previous MessageNext Message »
From:Kaplenko Vitaliy Date:July 19 2011 11:29am
Subject:undefined symbol: _ZN7mysqlpp10ConnectionD1Ev
View as plain text  
Dear MySQL++ Community,

My environment:
Linux 2.6.38.8-32.fc15.x86_64 #1 SMP Mon Jun 13 19:49:05 UTC 2011 x86_64 
x86_64 x86_64 GNU/Linux;
gcc version 4.6.0 20110530 (Red Hat 4.6.0-9) (GCC);
mysql++-3.1.0
mysql  Ver 14.14 Distrib 5.5.13, for Linux (x86_64) using readline 5.1
Server version: Apache/2.2.17 (Unix), Server built:   Mar  7 2011 09:51:54;

All files that in attachment compile Ok when row 4 (in 
mod_contconnect.cpp) is remarked or not,
but
when in mod_contconnect.cpp row 4 is remarked, then Apache server
restart Ok by command (run ./rootExecForApacheModule):
# service httpd restart
If row 4 is not remarked, then when try
# service httpd restart
Restarting httpd (via systemctl):  Job failed. See system logs and 
'systemctl status' for details.
If after that run command:
# httpd --help
httpd: Syntax error on line 204 of /etc/httpd/conf/httpd.conf: Cannot 
load /etc/httpd/modules/mod_helloworld.so into server: 
/etc/httpd/modules/mod_helloworld.so: undefined symbol: 
_ZN7mysqlpp10ConnectionD1Ev


mod_helloworld.c is an Apache Module, a simple content generator.
It was published on page 133 in
The Apache Modules Book: Application Development with Apache
by Nick Kew
Publisher: Prentice Hall
Pub Date: January 26, 2007
Print ISBN-10: 0-13-240967-4
Print ISBN-13: 978-0-13-240967-4
Pages: 592

In the mod_helloworld.c Rows 7 and 23 were added for compile
.c and .cpp files together.

Help me solve this problem, please.

Thanks in advance,
Vitaliy Kaplenko

     1	mod_helloworld: mod_helloworld.o mod_contconnect.o
     2		g++ -shared -o mod_helloworld.so mod_helloworld.o mod_contconnect.o
     3	mod_contconnect.o: mod_contconnect.cpp
     4		g++ -c -g -O2 -Wall -fPIC -I/usr/include/mysql++ -I/usr/include/mysql
mod_contconnect.cpp
     5	mod_helloworld.o: mod_helloworld.c
     6		cc -c -g -O2 -Wall -fPIC -I/usr/include/httpd -I/usr/include/apr-1
mod_helloworld.c

Attachment: [text/x-c++src] mod_contconnect.cpp
1 #include <httpd.h> 2 #include <http_protocol.h> 3 #include <http_config.h> 4 5 #include <http_log.h> 6 7 extern const char* GetHtmlPage(); 8 9 static int helloworld_handler(request_rec* r) 10 { 11 apr_status_t rv; 12 apr_bucket_brigade *bb; 13 apr_bucket *b; 14 15 if (!r->handler || strcmp(r->handler, "helloworld")) 16 return DECLINED; 17 18 if (r->method_number != M_GET) 19 return HTTP_METHOD_NOT_ALLOWED; 20 21 bb = apr_brigade_create(r->pool, r->connection->bucket_alloc); 22 ap_set_content_type(r, "text/html;charset=utf-8"); 23 const char* pchHtmlPage = GetHtmlPage(); 24 b = apr_bucket_immortal_create(pchHtmlPage, strlen(pchHtmlPage), bb->bucket_alloc); 25 APR_BRIGADE_INSERT_TAIL(bb, b); 26 APR_BRIGADE_INSERT_TAIL(bb, 27 apr_bucket_eos_create(bb->bucket_alloc)); 28 rv = ap_pass_brigade(r->output_filters, bb); 29 if (rv != APR_SUCCESS) { 30 ap_log_rerror(APLOG_MARK, APLOG_ERR, rv, r, "Output Error"); 31 return HTTP_INTERNAL_SERVER_ERROR; 32 } 33 34 return OK; 35 } 36 37 static void register_hooks(apr_pool_t* pool) 38 { 39 ap_hook_handler(helloworld_handler, NULL, NULL, APR_HOOK_MIDDLE); 40 } 41 42 module AP_MODULE_DECLARE_DATA helloworld_module = { 43 STANDARD20_MODULE_STUFF, 44 NULL, 45 NULL, 46 NULL, 47 NULL, 48 NULL, 49 register_hooks 50 }; 1 #!/bin/sh 2 3 SOURCEDIR="./" 4 TARGETDIR="/usr/lib64/httpd/modules/" 5 MODULENAME="mod_helloworld.so" 6 7 cp -fv $SOURCEDIR$MODULENAME $TARGETDIR 8 chmod -v 755 $TARGETDIR$MODULENAME 9 service httpd restart
Thread
undefined symbol: _ZN7mysqlpp10ConnectionD1EvKaplenko Vitaliy19 Jul
  • Re: undefined symbol: _ZN7mysqlpp10ConnectionD1EvMichael Radzewitz19 Jul
    • Re: undefined symbol: _ZN7mysqlpp10ConnectionD1EvJonathan Wakely19 Jul
      • Re: undefined symbol: _ZN7mysqlpp10ConnectionD1EvMichael Radzewitz19 Jul
  • Re: undefined symbol: _ZN7mysqlpp10ConnectionD1EvJonathan Wakely19 Jul
    • Re: undefined symbol: _ZN7mysqlpp10ConnectionD1EvKaplenko Vitaliy19 Jul
      • Re: undefined symbol: _ZN7mysqlpp10ConnectionD1EvJonathan Wakely19 Jul
        • Re: undefined symbol: _ZN7mysqlpp10ConnectionD1EvKaplenko Vitaliy19 Jul