List:MySQL++« Previous MessageNext Message »
From:Kaplenko Vitaliy Date:July 19 2011 12:50pm
Subject:Re: undefined symbol: _ZN7mysqlpp10ConnectionD1Ev
View as plain text  
Jonathan Wakely wrote:
> On 19 July 2011 13:24, Kaplenko Vitaliy<dij@stripped>  wrote:
>    
>> Jonathan Wakely wrote:
>>      
>>> On 19 July 2011 12:29, Kaplenko Vitaliy wrote:
>>>
>>>        
>>>> 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.
>>>>
>>>>          
>>> You haven't linked to the mysql++ library
>>>
>>> Add -lmysqlpp to the link command for mod_helloworld.so
>>>
>>>
>>>        
>> I add -lmysqlpp to the link command for mod_helloworld.so:
>> # g++ -shared -o -lmysqlpp mod_helloworld.so mod_helloworld.o
>> mod_contconnect.o
>>      
> Not there.  You have said "-o -lmysqlpp" which means "write the output
> to a file called -lmysqlpp"
>
> You need "-o mod_hellowworld.so" so the output goes to that file and
> -lmysqlpp somewhere else on the line (I suggest the very end)
>
> (You have probably created a file called -lmysqlpp, you will want to
> remove that.)
>
>    
>> But after that ldd report:
>> # ldd /usr/lib64/httpd/modules/mod_helloworld.so
>>         linux-vdso.so.1 =>    (0x00007fffe7f5c000)
>>         libstdc++.so.6 =>  /usr/lib64/libstdc++.so.6 (0x00007f82c03d7000)
>>         libm.so.6 =>  /lib64/libm.so.6 (0x00007f82c0153000)
>>         libgcc_s.so.1 =>  /lib64/libgcc_s.so.1 (0x00007f82bff3d000)
>>         libc.so.6 =>  /lib64/libc.so.6 (0x00007f82bfba4000)
>>         /lib64/ld-linux-x86-64.so.2 (0x0000003048e00000)
>>      
> That's because you didn't rebuild mod_helloworld.so
>
>    
After correct link command:
# g++ -shared -o mod_helloworld.so -lmysqlpp mod_helloworld.o 
mod_contconnect.o
Apache server restart Ok:
# service httpd restart
Restarting httpd (via systemctl): [Ok]

Thank you very match, Jonathan!

Vitaliy.
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