undefined reference to symbol 'XF86VidModeQueryExtension'

Linux specific forum
benmalartre
User
User
Posts: 27
Joined: Thu Mar 14, 2013 11:24 am
Location: paris
Contact:

undefined reference to symbol 'XF86VidModeQueryExtension'

Post by benmalartre »

Hello,
I just upgraded PureBasic to 5.4
My code works fine on 5.3
However here is the complete error

/usr/bin/ld: /home/benmalartre/RnD/libs/x64/linux/glfw3.a(x11_init.c.o): undefined reference to symbol 'XF86VidModeQueryExtension'
/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../x86_64-linux-gnu/libXxf86vm.so: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status

in my code I have ImportC "-lXxf86vm" : EndImport

Any ideas??
Fred
Administrator
Administrator
Posts: 16690
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Re: undefined reference to symbol 'XF86VidModeQueryExtension

Post by Fred »

Are you sure it still work fine with 5.3 on the same computer ? This error is wierd, as we didn't changed anything regarding XF86VidModeQueryExtension. Code snippet would be welcome.
benmalartre
User
User
Posts: 27
Joined: Thu Mar 14, 2013 11:24 am
Location: paris
Contact:

Re: undefined reference to symbol 'XF86VidModeQueryExtension

Post by benmalartre »

Hello,
I confirm that the same sources compile on 5.3 and not on 5.4 (Ubuntu 14.04 on a laptop Intel® Core™ i5-3317U CPU @ 1.70GHz × 4)

I redducced the code to a test exemple and it's now another symbol("XConvertSelection"), but same kind of error

here the linker error

/usr/bin/ld: /home/benmalartre/RnD/PureBasic/Modules/libs/x64/linux/glfw3.a(x11_window.c.o): undefined reference to symbol 'XConvertSelection'
/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../x86_64-linux-gnu/libX11.so: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status

here is my dependencies include snippet

Code: Select all

    ImportC "libs/x64/linux/glfw3.a" : EndImport
    ImportC "-lm" : EndImport
    ImportC "-lXinerama" : EndImport  
    ImportC "-lXi" : EndImport  
    ImportC "-lXrandr" : EndImport 
    ImportC "-lXcursor" : EndImport
    ImportC "-lXxf86vm" : EndImport 
    ImportC "-lX11" : EndImport 
    ImportC "-lGL" : EndImport
    ImportC "-lGLU" : EndImport 
    
    ImportC "libs/x64/linux/glfw3.a"
here is the full source code
http://benmalartre.free.fr/datas/source ... lem.tar.gz

there are some test files and some modules files + some C/C++ libraries

the simpliest exemple is "TestLinux.pbi", which compile and run fine on PB5.3 and output the above error when compiling with PB5.4


Thanks in advance
for now I stick on PB5.3 for this project...

edit:
the changing symbol is due to compiling in debug or release mode...

Ben
benmalartre
User
User
Posts: 27
Joined: Thu Mar 14, 2013 11:24 am
Location: paris
Contact:

Re: undefined reference to symbol 'XF86VidModeQueryExtension

Post by benmalartre »

Narrowing down the problem, I now compile with success in debug mode
(by removing an occurence of MessageRequester!!!)
but release output this error in PB 5.4

note that the missing symbol changed again:

/usr/bin/ld: /home/benmalartre/RnD/PureBasic/Modules/libs/x64/linux/glfw3.a(monitor.c.o): undefined reference to symbol 'pow@@GLIBC_2.2.5'
/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../x86_64-linux-gnu/libm.so: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status

Same as before everything compile and run fine in PB5.3

I rebuilded the glfw lib from source, tried to link all dependencies gathered with pkg-config... without success
benmalartre
User
User
Posts: 27
Joined: Thu Mar 14, 2013 11:24 am
Location: paris
Contact:

Re: undefined reference to symbol 'XF86VidModeQueryExtension

Post by benmalartre »

I solved the problem by providing full path to static libs

Code: Select all

ImportC LIB_INCLUDE_PATH+"glfw3.a" : EndImport

  ImportC "/usr/lib/x86_64-linux-gnu/libX11.a" : EndImport  
  ImportC "/usr/lib/x86_64-linux-gnu/libXinerama.a" : EndImport  
  ImportC "/usr/lib/x86_64-linux-gnu/libXi.a" : EndImport  
  ImportC "/usr/lib/x86_64-linux-gnu/libXrandr.a" : EndImport 
  ImportC "/usr/lib/x86_64-linux-gnu/libXcursor.a" : EndImport
  ImportC "/usr/lib/x86_64-linux-gnu/libXxf86vm.a" : EndImport 
  ImportC "/usr/lib/x86_64-linux-gnu/libXext.a" : EndImport 
  ImportC "/usr/lib/x86_64-linux-gnu/libXfixes.a" : EndImport 
  ImportC "/usr/lib/x86_64-linux-gnu/libXrender.a" : EndImport 
  ImportC LIB_INCLUDE_PATH+"glfw3.a"
with previous code I wal linking to Shared Libraries...

So it's not a PB Bug,
Is it possible to remove a post?
Post Reply