Undefined reference to `TVirtualX::GetOpenGLScalingFactor()'

dear experts,
I am trying now to compile the latest tag and i get the following error message. It seems that there is some incompatibility for libX11TTF. I am using Ubuntu 12.10/gcc4.7.2
Can someone tell me which library i need to remove/install in order to get this ROOT release compile with my Ubuntu?
thanks.
g++ -shared -Wl,-soname,libGX11TTF.so -m32 -O2 -Wl,–no-undefined -Wl,–as-needed -o lib/libGX11TTF.so graf2d/x11ttf/src/TGX11TTF.o graf2d/x11ttf/src/G__X11TTF.o -L/usr/lib/i386-linux-gnu -lfreetype -lz -Llib -lGX11 -lGraf -lXpm -lXext -lX11 -lXft -Llib -lCore -lCint -ldl
graf2d/x11ttf/src/TGX11TTF.o:(.data.rel.ro._ZTV8TGX11TTF[_ZTV8TGX11TTF]+0x120): undefined reference to TVirtualX::GetOpenGLScalingFactor()' graf2d/x11ttf/src/TGX11TTF.o:(.data.rel.ro._ZTV8TGX11TTF[_ZTV8TGX11TTF]+0x124): undefined reference toTVirtualX::CreateOpenGLWindow(unsigned long, unsigned int, unsigned int, std::vector<std::pair<unsigned int, int>, std::allocator<std::pair<unsigned int, int> > > const&)'
graf2d/x11ttf/src/TGX11TTF.o:(.data.rel.ro._ZTV8TGX11TTF[_ZTV8TGX11TTF]+0x128): undefined reference to TVirtualX::CreateOpenGLContext(unsigned long, unsigned long)' graf2d/x11ttf/src/TGX11TTF.o:(.data.rel.ro._ZTV8TGX11TTF[_ZTV8TGX11TTF]+0x12c): undefined reference toTVirtualX::MakeOpenGLContextCurrent(unsigned long, unsigned long)'
graf2d/x11ttf/src/TGX11TTF.o:(.data.rel.ro._ZTV8TGX11TTF[_ZTV8TGX11TTF]+0x130): undefined reference to TVirtualX::GetCurrentOpenGLContext()' graf2d/x11ttf/src/TGX11TTF.o:(.data.rel.ro._ZTV8TGX11TTF[_ZTV8TGX11TTF]+0x134): undefined reference toTVirtualX::FlushOpenGLBuffer(unsigned long)'
collect2: error: ld returned 1 exit status
make: *** [lib/libGX11TTF.so] Error 1

Do you install from the scratch or just updating some source tree?
Your errors are quite weird: these functions are implemented for Mac OS X and TGCocoa only,
in all other cases (and in your case) there are empty implementations in the core/base/src/TVirtualX.cxx (and thus in libCore.so).

hi,
it is installed from scratch. I attach the config.log in case one sees something obvious.
cfg.txt (269 KB)

[quote=“Nabil”]hi,
it is installed from scratch. I attach the config.log in case one sees something obvious.[/quote]

I have an Ubuntu 12.10 in a virtual box, I’ll have a look.

Hi,
i confirm this is happening with the latest ROOT stable tag only, namely: 5.34/03
if i try with 5.32/04, it works fine and i can compile the ROOT machinery.
Indeed, if one looks into this file:
root.cern.ch/root/changelog/ChangeLog-aa
one can read:
2012-10-24 15:04 rdm

[color=#FF0000] * [r46779] core/base/inc/TVirtualX.h, core/base/src/TVirtualX.cxx:
From Timur:
add GetOpenGLScalingFactor() to handle proper scaling on Retina
displays.
[/color]
No need to tell, that I really need the latest stable tag here. I welcome any inputs here.
thanks.

I know who made this commit and why I made this commit. The error you have means you are linking with the wrong library. Can you first check, that you removed old ROOT’s libs?

Hi,
thanks for your reply. what do you mean with “remove” old libraries?
I had no other ROOT library installed. I tried to install 5.32/04 AFTER 5.34/03 failed.
Is there some obvious workaround to my problem here?
did you manage to get it compile on your Ubuntu 12.10/Virtualbox?
thanks.

[quote=“Nabil”]Hi,
thanks for your reply. what do you mean with “remove” old libraries?
[/quote]

Literally, search for other libCore.so files in your system and remove them (if you decided to upgrade ROOT and don’t need old versions.

I have no idea, what your system is. Is it a fresh instal of Ubuntu? What packages did you install? Has somebody installed ROOT before? There are a lot of possibilities.

Yes, there is the simplest obvious workaround, find and remove other libCore.so.
Also, you can probably configure linker where to search.

Yes, and I was able to reproduce your problem: I first compiled quite old version of ROOT (pre 5.34) and copied resulting libCore.so to /usr/lib. After that I started compiling ROOT 5.34 and got the same linker error as you did.
So I’ve just removed libCore.so from the /usr/lib.
This does not mean that in your case libCore.so is in /usr/lib,
but it’s still in somewhere where linker can find it before the correct libCore.

In general, make sure you have “completely removed” (i.e. use “remove with any associated configuration files”) all standard Ubuntu’s ROOT packages (this also removes the “/etc/root” subdirectory).
In the “Synaptic Package Manager”, in the “Quick search” field, type “cern root”, then select all (Ctrl-A) found packages and mark them to be “completely removed”, then click the “Apply” button.
See also [url]ROOTSYS and linux distribution installation and [url]Release 5.32.03 on Ubuntu 12.04

hi,
i checked i did not have any deb ROOT package, nor some library sitting in /usr/lib which would screw up the installation.
thanks.

[quote=“Nabil”]hi,
i checked i did not have any deb ROOT package, nor some library sitting in /usr/lib which would screw up the installation.
thanks.[/quote]

Do:

locate libCore.so

And show the output here.

I have the feeling you’re suspicious about the reply i provided you with :slight_smile:.
Here it is:
ghodbane@pcclratl12:/opt/root/root-5.34-03$ locate libCore.so
/opt/root/root-5.32-04/lib/libCore.so
/opt/root/root-5.34-03/lib/libCore.so
the two libraries are associated to the two attemps I made: 5.32-04 works fine. and 5.34-03 fails.
I checked everything is settled consistently before compiling the software from scratch again and again. Given all this painful iterative process, i finally decided to take one hour or two and installed CERNVM which provides me what i need.
thanks for your help.
nabil.

I got … /opt/Adobe AIR/Versions/1.0/libCore.so :mrgreen:
Try maybe to “locate libCore” (should give you ALL “libCore*” files). :wink:

I believe you installed Adobe differently. I downloaed it. Here it is…
ghodbane@pcclratl12:~$ ls /opt/Adobe AIR/Versions/1.0/libCore.so
ls: cannot access AIR/Versions/1.0/libCore.so: No such file or directory
ghodbane@pcclratl12:/opt/Adobe/Reader9$ cd /opt/Adobe/Reader9/
ghodbane@pcclratl12:/opt/Adobe/Reader9$ find . -name “libCore*” -print
ghodbane@pcclratl12:/opt/Adobe/Reader9$ find / -name “libCore*” -print
ghodbane@pcclratl12:/opt/Adobe/Reader9$

mine as you can see is sitting in /opt/Adobe:
Reader9

Again:
ghodbane@pcclratl12:~$ locate libCore.so
/opt/root/root-5.32-04/lib/libCore.so
/opt/root/root-5.34-03/lib/libCore.so
ghodbane@pcclratl12:~$

moreover:
ghodbane@pcclratl12:/opt/Adobe/Reader9$ ls -ltr /opt
total 48
drwxr-xr-x 3 root root 4096 Nov 23 21:22 vidyo
drwxr-xr-x 3 root root 4096 Nov 24 16:48 google
drwxr-xr-x 4 root root 4096 Nov 24 18:11 openoffice.org
drwxr-xr-x 3 root root 4096 Nov 24 18:31 Adobe
drwxr-xr-x 6 root root 4096 Nov 26 11:12 openoffice.org3
drwxr-xr-x 7 ghodbane ghodbane 4096 Nov 27 10:34 pacman-3.29
drwxr-xr-x 4 root root 4096 Nov 28 10:09 brother
drwxr-xr-x 3 ghodbane ghodbane 4096 Nov 29 11:32 atlas-gcc
drwxr-xr-x 3 root root 4096 Dec 4 18:29 extras.ubuntu.com
drwxr-xr-x 4 root root 4096 Dec 10 16:03 atlas-sw
drwxr-xr-x 4 ghodbane ghodbane 4096 Dec 11 13:52 root
drwxr-xr-x 4 ghodbane ghodbane 4096 Dec 11 21:53 VirtualBox

Forget my “Adobe AIR”, that was just a joke. :wink:
Try (this should give you all files, including “.so” and “.a”, if they exist):
locate libCore

Ok Will, I understand you want me to type again and again “locate libCore.so:slight_smile:
if you take time to read carefully my replies, you will see that i did that already.
Anyhow, as i said, i do have a working ROOT release now thanks to this Cernvm machinery which provides it.
thanks.

[quote=“Nabil”]Ok Will, I understand you want me to type again and again “locate libCore.so:slight_smile:
if you take time to read carefully my replies, you will see that i did that already.
Anyhow, as i said, i do have a working ROOT release now thanks to this Cernvm machinery which provides it.
thanks.[/quote]

If you read his replies carefully, you’ll see he’s asking not about your Adobe and not about libCore.so, but about libCore (without *.so).

ok. here it is:
ghodbane@pcclratl12:~$ locate libCore
/opt/root/root-5.32-04/lib/libCore.rootmap
/opt/root/root-5.32-04/lib/libCore.so
/opt/root/root-5.34-03/lib/libCore.so
ghodbane@pcclratl12:~$
see you.

[quote=“Nabil”]ok. here it is:
ghodbane@pcclratl12:~$ locate libCore
/opt/root/root-5.32-04/lib/libCore.rootmap
/opt/root/root-5.32-04/lib/libCore.so
/opt/root/root-5.34-03/lib/libCore.so
ghodbane@pcclratl12:~$
see you.[/quote]

Can you, please, make a simple test (this is not to solve your problem, since I do not understand it, but to check my guess) - in the source code of ROOT 5.32 (which you can build without errors), in core/base/inc/TVirtualX.h

add something like

virtual void DummyFunction();//do not forget virtual!

and in core/base/src/TVirtualX.cxx add:

void TVirtualX::DummyFunction()
{
}

And try to rebuild now, what will happen?

Also, for ROOT’s binary (5.32, which was successful), you can ask about its shared lib dependencies with 'ldd ’ (I’m not quite sure, if it can really help here).

almost three quarters has passed and no actual solution for this x11ttf problem of the 5.34

i am using linux mint and i just had to --disable-x11 to continue compiling and it prevents running gui things.
at least functions i need are working.

for 5.32, it cannot find the already installed libx11 (or 5.34 would say that too). great!!