Recent

Author Topic: BananaPi M3: "undefined reference to `XRRFreeMonitors' and 'XRRGetMonitors'  (Read 8690 times)

att2

  • Jr. Member
  • **
  • Posts: 52
Hello,
My hardware: Bananapi m3
Quote
pi@bpi-iot-ros-ai:~$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 16.04.1 LTS
Release:        16.04
Codename:       xenial
pi@bpi-iot-ros-ai:~$ uname -a
Linux bpi-iot-ros-ai 3.4.39-BPI-M3-Kernel #1 SMP PREEMPT Tue May 3 13:47:01 UTC 2016 armv7l armv7l armv7l GNU/Linux

I freshly installed Lazarus with
Quote
apt-get install fp-compiler-3.0.0
apt-get install lazarus-1.6

Trying to compile a test program results in:

Quote
Compile Project, Target: project1: Exit code 256, Errors: 1, Warnings: 2
project1.lpr(22,0) Warning: "crtbegin.o" not found, this will probably cause a linking failure
project1.lpr(22,0) Warning: "crtend.o" not found, this will probably cause a linking failure
/usr/bin/ld.bfd: warning: link.res contains output sections; did you forget -T?
//usr/lib/arm-linux-gnueabihf/libgdk-x11-2.0.so: undefined reference to `XRRFreeMonitors'
//usr/lib/arm-linux-gnueabihf/libgdk-x11-2.0.so: undefined reference to `XRRGetMonitors'
project1.lpr(22,0) Error: Error while linking

Yes, about the "crtbegin.o" I know I have to edit the GCC library path in /etc/fpc.cfg  - I will do that (later).
What really gets me clueless is the
//usr/lib/arm-linux-gnueabihf/libgdk-x11-2.0.so: undefined reference to `XRRFreeMonitors'
//usr/lib/arm-linux-gnueabihf/libgdk-x11-2.0.so: undefined reference to `XRRGetMonitors'

I did not fail to miss these double slashes "//" at the beginning. Some config file or other must be wrong.
Can you help me to fix that, please?

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 11383
  • FPC developer.
Try linking lib "Xrandr". Probably the distribution's libraries have some problem in their dependencies.

att2

  • Jr. Member
  • **
  • Posts: 52
which lib XRandr... link to where? Do I have to edit /etc/fpc.cfg or what do you mean exactly ?

Leledumbo

  • Hero Member
  • *****
  • Posts: 8746
  • Programming + Glam Metal + Tae Kwon Do = Me
My hardware: Bananapi m3
Better mention your OS, Banana Pi has more than 1 OS available.

att2

  • Jr. Member
  • **
  • Posts: 52
My hardware: Bananapi m3
Better mention your OS, Banana Pi has more than 1 OS available.
I thought that the "lsb_release" command was obvious? -> Ubuntu Mate 16.04.1 LTS "Xenial", based on the image from :

http://www.banana-pi.org/m3-download.html   ->  "Ubuntu 16.04 Mate desktop" (first in list on that page)

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 11383
  • FPC developer.
which lib XRandr... link to where? Do I have to edit /etc/fpc.cfg or what do you mean exactly ?

You need to tell the linker which libraries to link using $linklib in header units or using -k-l<libraryname>.

In theory, a library thus linked would automatically pull in all dependencies, but this does not always happen in practice.

The xrandr was just from googling the symbolnames to do an educated guess (and not more than that), to try to put you on the path.


 

TinyPortal © 2005-2018