# Undefined reference to \`TVirtualX::GetOpenGLScalingFactor()'

**URL:** <https://root-forum.cern.ch/t/undefined-reference-to-tvirtualx-getopenglscalingfactor/15356>\
**Category:** ROOT\
**Created:** [December 11, 2012, 9:43am UTC](https://root-forum.cern.ch/t/undefined-reference-to-tvirtualx-getopenglscalingfactor/15356 "2012-12-11T09:43:57Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nabil](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/n/e79b87/32.png) [@Nabil](https://root-forum.cern.ch/u/Nabil)\
**Post date:** [December 11, 2012, 9:43am UTC](https://root-forum.cern.ch/t/undefined-reference-to-tvirtualx-getopenglscalingfactor/15356/1 "2012-12-11T09:43:57Z")

</div>

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](http://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 to`TVirtualX::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 to`TVirtualX::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 to`TVirtualX::FlushOpenGLBuffer(unsigned long)'  
collect2: error: ld returned 1 exit status  
make: \*\*\* [lib/libGX11TTF.so] Error 1

---

<div class="post-metadata">

**Author:** ![tpochep](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/t/f05b48/32.png) [@tpochep](https://root-forum.cern.ch/u/tpochep)\
**Post date:** [December 11, 2012, 10:23am UTC](https://root-forum.cern.ch/t/undefined-reference-to-tvirtualx-getopenglscalingfactor/15356/2 "2012-12-11T10:23:52Z")

</div>

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](http://libCore.so)).

---

<div class="post-metadata">

**Author:** ![Nabil](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/n/e79b87/32.png) [@Nabil](https://root-forum.cern.ch/u/Nabil)\
**Post date:** [December 11, 2012, 10:28am UTC](https://root-forum.cern.ch/t/undefined-reference-to-tvirtualx-getopenglscalingfactor/15356/3 "2012-12-11T10:28:21Z")

</div>

hi,  
it is installed from scratch. I attach the config.log in case one sees something obvious.  
[cfg.txt](https://root-forum.cern.ch/uploads/default/original/2X/f/ffb23de6c4638b1644ce12e78f11643f20dedaff.txt) (269 KB)

---

<div class="post-metadata">

**Author:** ![tpochep](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/t/f05b48/32.png) [@tpochep](https://root-forum.cern.ch/u/tpochep)\
**Post date:** [December 11, 2012, 10:30am UTC](https://root-forum.cern.ch/t/undefined-reference-to-tvirtualx-getopenglscalingfactor/15356/4 "2012-12-11T10:30:31Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Nabil](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/n/e79b87/32.png) [@Nabil](https://root-forum.cern.ch/u/Nabil)\
**Post date:** [December 11, 2012, 12:13pm UTC](https://root-forum.cern.ch/t/undefined-reference-to-tvirtualx-getopenglscalingfactor/15356/5 "2012-12-11T12:13:57Z")

</div>

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](http://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.

---

<div class="post-metadata">

**Author:** ![tpochep](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/t/f05b48/32.png) [@tpochep](https://root-forum.cern.ch/u/tpochep)\
**Post date:** [December 11, 2012, 1:22pm UTC](https://root-forum.cern.ch/t/undefined-reference-to-tvirtualx-getopenglscalingfactor/15356/6 "2012-12-11T13:22:23Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![Nabil](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/n/e79b87/32.png) [@Nabil](https://root-forum.cern.ch/u/Nabil)\
**Post date:** [December 11, 2012, 1:59pm UTC](https://root-forum.cern.ch/t/undefined-reference-to-tvirtualx-getopenglscalingfactor/15356/7 "2012-12-11T13:59:04Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![tpochep](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/t/f05b48/32.png) [@tpochep](https://root-forum.cern.ch/u/tpochep)\
**Post date:** [December 11, 2012, 8:46pm UTC](https://root-forum.cern.ch/t/undefined-reference-to-tvirtualx-getopenglscalingfactor/15356/8 "2012-12-11T20:46:46Z")

</div>

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

> [@Nabil](#):
>
> I had no other ROOT library installed. I tried to install 5.32/04 AFTER 5.34/03 failed.

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.

> [@Nabil](#):
>
> Is there some obvious workaround to my problem here?

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

> [@Nabil](#):
>
> did you manage to get it compile on your Ubuntu 12.10/Virtualbox?

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.

---

<div class="post-metadata">

**Author:** ![Wile\_E\_Coyote](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/wile_e_coyote/32/12417_2.png) [@Wile\_E\_Coyote](https://root-forum.cern.ch/u/Wile_E_Coyote)\
**Post date:** [December 11, 2012, 10:20pm UTC](https://root-forum.cern.ch/t/undefined-reference-to-tvirtualx-getopenglscalingfactor/15356/9 "2012-12-11T22:20:36Z")

</div>

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](https://root-forum.cern.ch/t/rootsys-and-linux-distribution-installation/14173/6) and [url][Release 5.32.03 on Ubuntu 12.04](https://root-forum.cern.ch/t/release-5-32-03-on-ubuntu-12-04/14368/2)

---

<div class="post-metadata">

**Author:** ![Nabil](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/n/e79b87/32.png) [@Nabil](https://root-forum.cern.ch/u/Nabil)\
**Post date:** [December 12, 2012, 1:02am UTC](https://root-forum.cern.ch/t/undefined-reference-to-tvirtualx-getopenglscalingfactor/15356/10 "2012-12-12T01:02:48Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![tpochep](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/t/f05b48/32.png) [@tpochep](https://root-forum.cern.ch/u/tpochep)\
**Post date:** [December 12, 2012, 12:57pm UTC](https://root-forum.cern.ch/t/undefined-reference-to-tvirtualx-getopenglscalingfactor/15356/11 "2012-12-12T12:57:18Z")

</div>

[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](http://libCore.so)

And show the output here.

---

<div class="post-metadata">

**Author:** ![Nabil](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/n/e79b87/32.png) [@Nabil](https://root-forum.cern.ch/u/Nabil)\
**Post date:** [December 12, 2012, 1:07pm UTC](https://root-forum.cern.ch/t/undefined-reference-to-tvirtualx-getopenglscalingfactor/15356/12 "2012-12-12T13:07:15Z")

</div>

I have the feeling you’re suspicious about the reply i provided you with 🙂.  
Here it is:  
ghodbane@pcclratl12:/opt/root/root-5.34-03$ locate [libCore.so](http://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.

---

<div class="post-metadata">

**Author:** ![Wile\_E\_Coyote](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/wile_e_coyote/32/12417_2.png) [@Wile\_E\_Coyote](https://root-forum.cern.ch/u/Wile_E_Coyote)\
**Post date:** [December 12, 2012, 1:22pm UTC](https://root-forum.cern.ch/t/undefined-reference-to-tvirtualx-getopenglscalingfactor/15356/13 "2012-12-12T13:22:39Z")

</div>

I got … /opt/Adobe AIR/Versions/1.0/libCore.so ![:mrgreen:](https://root-forum.cern.ch/uploads/default/original/2X/2/2799b3ea86c419a02327c767288415b2a17e6ee1.gif "Mr. Green")  
Try maybe to “locate libCore” (should give you ALL “libCore\*” files). 😉

---

<div class="post-metadata">

**Author:** ![Nabil](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/n/e79b87/32.png) [@Nabil](https://root-forum.cern.ch/u/Nabil)\
**Post date:** [December 12, 2012, 1:25pm UTC](https://root-forum.cern.ch/t/undefined-reference-to-tvirtualx-getopenglscalingfactor/15356/14 "2012-12-12T13:25:27Z")

</div>

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](http://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](http://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](http://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

---

<div class="post-metadata">

**Author:** ![Wile\_E\_Coyote](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/wile_e_coyote/32/12417_2.png) [@Wile\_E\_Coyote](https://root-forum.cern.ch/u/Wile_E_Coyote)\
**Post date:** [December 12, 2012, 1:40pm UTC](https://root-forum.cern.ch/t/undefined-reference-to-tvirtualx-getopenglscalingfactor/15356/15 "2012-12-12T13:40:54Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Nabil](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/n/e79b87/32.png) [@Nabil](https://root-forum.cern.ch/u/Nabil)\
**Post date:** [December 12, 2012, 1:47pm UTC](https://root-forum.cern.ch/t/undefined-reference-to-tvirtualx-getopenglscalingfactor/15356/16 "2012-12-12T13:47:45Z")

</div>

Ok Will, I understand you want me to type again and again “locate [libCore.so](http://libCore.so)” 🙂  
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.

---

<div class="post-metadata">

**Author:** ![tpochep](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/t/f05b48/32.png) [@tpochep](https://root-forum.cern.ch/u/tpochep)\
**Post date:** [December 12, 2012, 1:57pm UTC](https://root-forum.cern.ch/t/undefined-reference-to-tvirtualx-getopenglscalingfactor/15356/17 "2012-12-12T13:57:12Z")

</div>

[quote=“Nabil”]Ok Will, I understand you want me to type again and again “locate [libCore.so](http://libCore.so)” 🙂  
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](http://libCore.so), but about libCore (without \*.so).

---

<div class="post-metadata">

**Author:** ![Nabil](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/n/e79b87/32.png) [@Nabil](https://root-forum.cern.ch/u/Nabil)\
**Post date:** [December 12, 2012, 2:01pm UTC](https://root-forum.cern.ch/t/undefined-reference-to-tvirtualx-getopenglscalingfactor/15356/18 "2012-12-12T14:01:54Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![tpochep](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/t/f05b48/32.png) [@tpochep](https://root-forum.cern.ch/u/tpochep)\
**Post date:** [December 12, 2012, 3:16pm UTC](https://root-forum.cern.ch/t/undefined-reference-to-tvirtualx-getopenglscalingfactor/15356/19 "2012-12-12T15:16:39Z")

</div>

[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).

---

<div class="post-metadata">

**Author:** ![yilmaz\_durmaz](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/y/b5e925/32.png) [@yilmaz\_durmaz](https://root-forum.cern.ch/u/yilmaz_durmaz)\
**Post date:** [September 4, 2013, 1:30pm UTC](https://root-forum.cern.ch/t/undefined-reference-to-tvirtualx-getopenglscalingfactor/15356/20 "2013-09-04T13:30:28Z")

</div>

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!!
