Thread: undefined reference - problem compiling pgadmin3

undefined reference - problem compiling pgadmin3

From
Luca Ferrari
Date:
Hi,
I'm tryin to compile pgadmin1.6.2 on kubuntu 6.1, wxwidgets 2.8, but I'm 
having this errors during make:

tlSQLBox.cpp:(.text+0xa5): undefined reference to `wx2stc(wxString const&)'
/usr/local/lib/libwx_gtk2u_stc-2.8.so: undefined reference to 
`wxFile::wxFile(char const*, wxFile::OpenMode)'
/usr/local/lib/libwx_gtk2u_ogl-2.8.so: undefined reference to 
`wxStringList::Add(char const*)'
/usr/local/lib/libwx_gtk2u_ogl-2.8.so: undefined reference to 
`wxLogFatalError(char const*, ...)'
/usr/local/lib/libwx_gtk2u_ogl-2.8.so: undefined reference to 
`wxString::Format(char const*, ...)'
/usr/local/lib/libwx_gtk2u_stc-2.8.so: undefined reference to 
`wxString::BeforeFirst(char) const'
/usr/local/lib/libwx_gtk2u_stc-2.8.so: undefined reference to 
`wxString::AfterFirst(char) const'
/usr/local/lib/libwx_gtk2u_ogl-2.8.so: undefined reference to 
`wxStringBase::ConcatSelf(unsigned int, char const*, unsigned int)'
/usr/local/lib/libwx_gtk2u_stc-2.8.so: undefined reference to 
`wxStringBase::InitWith(char const*, unsigned int, unsigned int)'
/usr/local/lib/libwx_gtk2u_stc-2.8.so: undefined reference to 
`wxString::Cmp(char const*) const'
/usr/local/lib/libwx_gtk2u_stc-2.8.so: undefined reference to 
`wxString::Find(char, bool) const'
/usr/local/lib/libwx_gtk2u_stc-2.8.so: undefined reference to 
`wxStringBase::wxStringBase(unsigned int, char)'
/usr/local/lib/libwx_gtk2u_stc-2.8.so: undefined reference to 
`wxWindow::ApplyToolTip(_GtkTooltips*, char const*)'
/usr/local/lib/libwx_gtk2u_ogl-2.8.so: undefined reference to 
`wxStringBase::operator=(char const*)'
collect2: ld returned 1 exit status
make[2]: *** [pgadmin3] Error 1
make[2]: Leaving directory `/home/luca/tmp/pgadmin3-1.6.2/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/luca/tmp/pgadmin3-1.6.2'
make: *** [all] Error 2


Any idea about that? 
Luca


Re: undefined reference - problem compiling pgadmin3

From
Alex Gorbachenko
Date:
On Thu, 1 Feb 2007 12:24:14 +0100
Luca wrote:

>Any idea about that?

can you show result of ldd -r /usr/local/lib/libwx_gtk2u_stc-2.8.so
here ?

--
np: Iron Maiden - The Nomad

Re: undefined reference - problem compiling pgadmin3

From
Luca Ferrari
Date:
On Thursday 01 February 2007 Alex Gorbachenko's cat, walking on the keyboard, 
wrote:
> ldd -r /usr/local/lib/libwx_gtk2u_stc-2.8.so
> here ?

ldd -r /usr/local/lib/libwx_gtk2u_stc-2.8.so       linux-gate.so.1 =>  (0xffffe000)       libz.so.1 =>
/usr/lib/libz.so.1(0xb7ea2000)       libdl.so.2 => /lib/tls/i686/cmov/libdl.so.2 (0xb7e9e000)       libgtk-x11-2.0.so.0
=>/usr/lib/libgtk-x11-2.0.so.0 (0xb7b4e000)       libgdk-x11-2.0.so.0 => /usr/lib/libgdk-x11-2.0.so.0 (0xb7ac9000)
libatk-1.0.so.0 => /usr/lib/libatk-1.0.so.0 (0xb7aaf000)       libgdk_pixbuf-2.0.so.0 =>
/usr/lib/libgdk_pixbuf-2.0.so.0(0xb7a99000)       libm.so.6 => /lib/tls/i686/cmov/libm.so.6 (0xb7a73000)
libfontconfig.so.1=> /usr/lib/libfontconfig.so.1 (0xb7a44000)       libXext.so.6 => /usr/lib/libXext.so.6 (0xb7a37000)
    libXrender.so.1 => /usr/lib/libXrender.so.1 (0xb7a2e000)       libXinerama.so.1 => /usr/lib/libXinerama.so.1
(0xb7a2b000)      libXi.so.6 => /usr/lib/libXi.so.6 (0xb7a23000)       libXrandr.so.2 => /usr/lib/libXrandr.so.2
(0xb7a20000)      libXcursor.so.1 => /usr/lib/libXcursor.so.1 (0xb7a17000)       libXfixes.so.3 =>
/usr/lib/libXfixes.so.3(0xb7a12000)       libpango-1.0.so.0 => /usr/lib/libpango-1.0.so.0 (0xb79d7000)
libX11.so.6=> /usr/lib/libX11.so.6 (0xb790e000)       libgobject-2.0.so.0 => /usr/lib/libgobject-2.0.so.0 (0xb78d4000)
    libgmodule-2.0.so.0 => /usr/lib/libgmodule-2.0.so.0 (0xb78d0000)       libgthread-2.0.so.0 =>
/usr/lib/libgthread-2.0.so.0(0xb78cb000)       libglib-2.0.so.0 => /usr/lib/libglib-2.0.so.0 (0xb7839000)
libSM.so.6=> /usr/lib/libSM.so.6 (0xb782f000)       libpng12.so.0 => /usr/lib/libpng12.so.0 (0xb780b000)
libwx_gtk2u_core-2.8.so.0=> /usr/local/lib/libwx_gtk2u_core-2.8.so.0 
 
(0xb7475000)       libwx_baseu-2.8.so.0 => /usr/local/lib/libwx_baseu-2.8.so.0 
(0xb7343000)       libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0xb7264000)       libgcc_s.so.1 => /lib/libgcc_s.so.1
(0xb7259000)      libpthread.so.0 => /lib/tls/i686/cmov/libpthread.so.0 (0xb7245000)       libc.so.6 =>
/lib/tls/i686/cmov/libc.so.6(0xb7111000)       /lib/ld-linux.so.2 (0x80000000)       libpangocairo-1.0.so.0 =>
/usr/lib/libpangocairo-1.0.so.0(0xb7109000)       libcairo.so.2 => /usr/lib/libcairo.so.2 (0xb70a7000)
libfreetype.so.6=> /usr/lib/libfreetype.so.6 (0xb703d000)       libexpat.so.1 => /usr/lib/libexpat.so.1 (0xb701e000)
  libXau.so.6 => /usr/lib/libXau.so.6 (0xb701b000)       libXdmcp.so.6 => /usr/lib/libXdmcp.so.6 (0xb7016000)
librt.so.1=> /lib/tls/i686/cmov/librt.so.1 (0xb700d000)       libICE.so.6 => /usr/lib/libICE.so.6 (0xb6ff5000)
libpangoft2-1.0.so.0=> /usr/lib/libpangoft2-1.0.so.0 (0xb6fc9000)
 
undefined symbol: _ZN8wxWindow12ApplyToolTipEP12_GtkTooltipsPKc 
(/usr/local/lib/libwx_gtk2u_stc-2.8.so)
undefined symbol: _ZN6wxFileC1EPKcNS_8OpenModeE 
(/usr/local/lib/libwx_gtk2u_stc-2.8.so)
undefined symbol: _ZNK8wxString11BeforeFirstEc  
(/usr/local/lib/libwx_gtk2u_stc-2.8.so)
undefined symbol: _ZNK8wxString10AfterFirstEc   
(/usr/local/lib/libwx_gtk2u_stc-2.8.so)
undefined symbol: _ZN12wxStringBase8InitWithEPKcjj      
(/usr/local/lib/libwx_gtk2u_stc-2.8.so)
undefined symbol: _ZNK8wxString3CmpEPKc 
(/usr/local/lib/libwx_gtk2u_stc-2.8.so)
undefined symbol: _ZNK8wxString4FindEcb 
(/usr/local/lib/libwx_gtk2u_stc-2.8.so)
undefined symbol: _ZN12wxStringBaseC2Ejc        
(/usr/local/lib/libwx_gtk2u_stc-2.8.so)



Re: undefined reference - problem compiling pgadmin3

From
Alex Gorbachenko
Date:
On Thu, 1 Feb 2007 14:17:14 +0100
Luca wrote:

>undefined symbol: _ZN8wxWindow12ApplyToolTipEP12_GtkTooltipsPKc
>(/usr/local/lib/libwx_gtk2u_stc-2.8.so)
>undefined symbol: _ZN6wxFileC1EPKcNS_8OpenModeE
>(/usr/local/lib/libwx_gtk2u_stc-2.8.so)
>undefined symbol: _ZNK8wxString11BeforeFirstEc
>(/usr/local/lib/libwx_gtk2u_stc-2.8.so)
>undefined symbol: _ZNK8wxString10AfterFirstEc
>(/usr/local/lib/libwx_gtk2u_stc-2.8.so)
>undefined symbol: _ZN12wxStringBase8InitWithEPKcjj
>(/usr/local/lib/libwx_gtk2u_stc-2.8.so)
>undefined symbol: _ZNK8wxString3CmpEPKc
>(/usr/local/lib/libwx_gtk2u_stc-2.8.so)
>undefined symbol: _ZNK8wxString4FindEcb
>(/usr/local/lib/libwx_gtk2u_stc-2.8.so)
>undefined symbol: _ZN12wxStringBaseC2Ejc
>(/usr/local/lib/libwx_gtk2u_stc-2.8.so)

libwx_gtk2u_stc-2.8.so is not linked with some other wxgtk libs.

in shell type:

for LIBS in $(/bin/ls /usr/local/lib/libwx*so) ; do echo "$LIBS" ;
objdump -T "$LIBS" | grep -i '<undef_symbol_func_name>' ; done

this could help to find necessary libraries.

--
np: Iron Maiden - No More Lies

Re: undefined reference - problem compiling pgadmin3

From
Luca Ferrari
Date:
On Thursday 01 February 2007 Alex Gorbachenko's cat, walking on the keyboard, 
wrote:
>
> for LIBS in $(/bin/ls /usr/local/lib/libwx*so) ; do echo "$LIBS" ;
> objdump -T "$LIBS" | grep -i '<undef_symbol_func_name>' ; done
>


It returns

/usr/local/lib/libwx_baseu-2.8.so
/usr/local/lib/libwx_baseu_net-2.8.so
/usr/local/lib/libwx_baseu_xml-2.8.so
/usr/local/lib/libwx_gtk2_fl-2.8.so
/usr/local/lib/libwx_gtk2_gizmos-2.8.so
/usr/local/lib/libwx_gtk2_gizmos_xrc-2.8.so
/usr/local/lib/libwx_gtk2_mmedia-2.8.so
/usr/local/lib/libwx_gtk2_ogl-2.8.so
/usr/local/lib/libwx_gtk2_plot-2.8.so
/usr/local/lib/libwx_gtk2_stc-2.8.so
/usr/local/lib/libwx_gtk2_svg-2.8.so
/usr/local/lib/libwx_gtk2u_adv-2.8.so
/usr/local/lib/libwx_gtk2u_aui-2.8.so
/usr/local/lib/libwx_gtk2u_core-2.8.so
/usr/local/lib/libwx_gtk2u_fl-2.8.so
/usr/local/lib/libwx_gtk2u_gizmos-2.8.so
/usr/local/lib/libwx_gtk2u_gizmos_xrc-2.8.so
/usr/local/lib/libwx_gtk2u_html-2.8.so
/usr/local/lib/libwx_gtk2u_mmedia-2.8.so
/usr/local/lib/libwx_gtk2u_ogl-2.8.so
/usr/local/lib/libwx_gtk2u_plot-2.8.so
/usr/local/lib/libwx_gtk2u_qa-2.8.so
/usr/local/lib/libwx_gtk2u_richtext-2.8.so
/usr/local/lib/libwx_gtk2u_stc-2.8.so
/usr/local/lib/libwx_gtk2u_svg-2.8.so
/usr/local/lib/libwx_gtk2u_xrc-2.8.so

and all the above are under /usr/local/lib that is listed in 
my /etc/ld.so.conf (I ran ldconfig a few times).
How can I proceed?

Thanks,
Luca


Re: undefined reference - problem compiling pgadmin3

From
Alex Gorbachenko
Date:
On Fri, 2 Feb 2007 09:15:42 +0100
Luca wrote:

>It returns
[skipped]

hmmm... very strange behavior. can you show output of
objdump -T /usr/local/lib/libwx_baseu-2.8.so | grep 'wxStringBase.*Init'

>and all the above are under /usr/local/lib that is listed in
>my /etc/ld.so.conf (I ran ldconfig a few times).
>How can I proceed?

your problem is not there.

when you build wxgtk contribs (i.e. ogl), core and base wxgtk libs is
not present in linker options.

example for "right" build flags: "-Wl,-L<wxbuilddir>/lib
-lwx_gtk2u_core-2.8 -lwx_baseu-2.8"

change dir to <wxbuilddir>/contrib/src/ogl and type make clean && make.
at the end of report you should see string with linker options. for
example, my string is:

g++ -shared -fPIC
-o /home/agent_007/RPM/BUILD/wxGTK-2007-01-31/lib/libwx_gtk2u_ogl-2.8.so.0.0.0
ogldll_basic2.o ogldll_canvas.o ogldll_divided.o ogldll_mfutils.o
ogldll_oglmisc.o ogldll_basic.o ogldll_composit.o ogldll_drawn.o
ogldll_bmpshape.o ogldll_constrnt.o ogldll_lines.o ogldll_ogldiag.o
-pthread -Wl,--as-needed
-L/home/agent_007/RPM/BUILD/wxGTK-2007-01-31/lib
-Wl,-soname,libwx_gtk2u_ogl-2.8.so.0   -lz -ldl -lm     -pthread
-lgtk-x11-2.0 -lgdk-x11-2.0 -latk-1.0 -lgdk_pixbuf-2.0 -lm -lpango-1.0
-lgobject-2.0 -lgmodule-2.0 -ldl -lgthread-2.0 -lglib-2.0 -lXinerama
-lXxf86vm -lSM -lpng -lz -ljpeg -ltiff     -pthread -Wl,--as-needed
-Wl,--version-script,/home/agent_007/RPM/BUILD/wxGTK-2007-01-31/version-script
-lz -ldl -lm  -lwx_gtk2u_core-2.8  -lwx_baseu-2.8

--
np: Bullet for My Valentine - No Control

Re: undefined reference - problem compiling pgadmin3

From
Luca Ferrari
Date:
On Friday 02 February 2007 Alex Gorbachenko's cat, walking on the keyboard, 
wrote:
> hmmm... very strange behavior. can you show output of
> objdump -T /usr/local/lib/libwx_baseu-2.8.so | grep 'wxStringBase.*Init'

0009f1c0 g    DF .text  0000008d  WXU_2.8     _ZN12wxStringBase8InitWithEPKwjj

> when you build wxgtk contribs (i.e. ogl), core and base wxgtk libs is
> not present in linker options.

but I've installed wx, run ldconfig and then build the contribs. 

>
> example for "right" build flags: "-Wl,-L<wxbuilddir>/lib
> -lwx_gtk2u_core-2.8 -lwx_baseu-2.8"
>
> change dir to <wxbuilddir>/contrib/src/ogl and type make clean && make.
> at the end of report you should see string with linker options. for
> example, my string is:
>


It seems right to me, isn't it?

g++ -shared -fPIC -o /home/luca/tmp/wxWidgets-2.8.0/lib/libwx_gtk2u_ogl-2.8.so.0.0.0  
ogldll_basic2.o ogldll_canvas.o ogldll_divided.o ogldll_mfutils.o 
ogldll_oglmisc.o ogldll_basic.o ogldll_composit.o ogldll_drawn.o 
ogldll_bmpshape.o ogldll_constrnt.o ogldll_lines.o 
ogldll_ogldiag.o -pthread     -L/home/luca/tmp/wxWidgets-2.8.0/lib   -Wl,-soname,libwx_gtk2u_ogl-2.8.so.0   -lz -ldl
-lm -lwxtiff-2.8 -lwxjpeg-2.8  -pthread -lgtk-x11-2.0 -lgdk-x11-2.0 -latk-1.0 -lgdk_pixbuf-2.0 -lm -lfontconfig -lXext
-lXrender-lXinerama -lXi -lXrandr -lXcursor -lXfixes -lpango-1.0 -lX11 -lgobject-2.0 -lgmodule-2.0 -ldl -lgthread-2.0
-lglib-2.0-lXinerama -lSM -lpng -lz   -lwxregexu-2.8  -pthread
-Wl,--version-script,/home/luca/tmp/wxWidgets-2.8.0/version-script-lz -ldl -lm  -lwx_gtk2u_core-2.8  -lwx_baseu-2.8
 

Should I set other options?

Thanks,
Luca


Re: undefined reference - problem compiling pgadmin3

From
Alex Gorbachenko
Date:
On Fri, 2 Feb 2007 12:00:09 +0100
Luca wrote:

>but I've installed wx, run ldconfig and then build the contribs.

imho, wxgtk bulds normally only in wxgtk source tree, and you must
compile at once main package along with contribs.

currently, i maintain wxGTK and pgadmin3 for russian ALTLinux distro. i
was routinely build rpm packages, and all works fine.

>It seems right to me, isn't it?

yes, that's right.

[skipped]

>Should I set other options?

no.


--
np: Bullet for my Valentine - suffocating under words of sorrow (what
can i do) (live at brixton academy)

Re: undefined reference - problem compiling pgadmin3

From
Alex Gorbachenko
Date:
On Fri, 2 Feb 2007 12:00:09 +0100
Luca wrote:

>Should I set other options?

why you don't use binary wx distributions for ubuntu ?
http://wxpython.wxcommunity.com/apt/ubuntu/dapper/2.8.1.1/

--
np: Bullet for my Valentine - suffocating under words of sorrow (what
can i do) (live at brixton academy)

Re: undefined reference - problem compiling pgadmin3

From
Luca Ferrari
Date:
On Friday 02 February 2007 Alex Gorbachenko's cat, walking on the keyboard, 
wrote:
> why you don't use binary wx distributions for ubuntu ?
> http://wxpython.wxcommunity.com/apt/ubuntu/dapper/2.8.1.1/


Well, from the above link I took the src library, recompiled it and now I've 
got the pgadmin3 working! I'm quite astonished by this strange behaviour, but 
now it works!

Thanks everyone for the support, and if someone has a clue about what happened 
please advice.

Luca