0

I am unable to link my application: I am getting 'undefined reference to symbol 'gdk_pixbuf_major_version'

I am a WIN32 programmer and this is my first foray into Linux. My target device is Ubuntu xenial, GTK+ 3.18.9. From gdk_pixbuf_features.h the Gdk-Pixbuf version is 2.32.2.

I have a static library (_rUtilitiesLinuxx64) which does this: GdkPixBuffMajorRunTime=gdk_pixbuf_major_version; The static library builds just fine.

I have an application (_rUtilitiesTestLinux) which is linking to _rUtilitiesLinuxx64.

My assumption is that gdk_pixbuf_major_version is actually in the Gdk_Pixbuf library (/usr/lib/x86_64-linux-gnu/libgdk_pixbuf-2.0.so)

When I attempt to build my application I am getting an undefined reference to 'gdk_pixbuf_major_version'

It seems that gdk_pixbuf_major_version is not contained within libgdk_pixbuf-2.0?

Invoking ld
1>    g++     -o "/home/rob/projects/_rUtilitiesTestLinux/bin/x64/Debug/_rUtilitiesTestLinux.out" -Wl,--no-undefined -Wl,-L/home/rob/projects/_rUtilitiesLinux/bin/x64/Debug -Wl,-z,relro -Wl,-z,now -Wl,-z,noexecstack 
/home/rob/projects/_rUtilitiesTestLinux/obj/x64/Debug/main.o 
/home/rob/projects/_rUtilitiesTestLinux/obj/x64/Debug/TestClass.o 

/usr/lib/x86_64-linux-gnu/libgtk-3.so 
/usr/lib/x86_64-linux-gnu/libgdk-3.so 
/usr/lib/x86_64-linux-gnu/libgio-2.0.so 
/usr/lib/x86_64-linux-gnu/libgobject-2.0.so 
/usr/lib/x86_64-linux-gnu/libpthread.so 
/usr/lib/x86_64-linux-gnu/libglib-2.0.so 
/usr/lib/x86_64-linux-gnu/libgdk_pixbuf-2.0.so 
-l_rUtilitiesLinuxx64

1>    /usr/bin/ld: 
/home/rob/projects/_rUtilitiesLinux/bin/x64/Debug/lib_rUtilitiesLinuxx64.a(_rGraphwSystem.o):/usr/bin/ld: 
/home/rob/projects/_rUtilitiesLinux/bin/x64/Debug/lib_rUtilitiesLinuxx64.a(_rGraphwSystem.o): undefined reference to symbol 'gdk_pixbuf_major_version'

1>    /usr/lib/x86_64-linux-gnu/libgdk_pixbuf-2.0.so: error adding symbols: DSO missing from  undefined reference to symbol 'gdk_pixbuf_major_version'
1>    /usr/lib/x86_64-linux-gnu/libgdk_pixbuf-2.0.so: error adding symbols: DSO missing from command line
1>    command line
1>    collect2: error: ld returned 1 exit status
1>    collect2: error: ld returned 1 exit status
1>    /usr/bin/ld : error : undefined reference to symbol 'gdk_pixbuf_major_version'
1>    /usr/lib/x86_64-linux-gnu/libgdk_pixbuf-2.0.so : error : DSO missing from command line
1>    collect2 : error : ld returned 1 exit status

So, where is gdk_pixbuf_major_version?

Cody Gray - on strike
  • 239,200
  • 50
  • 490
  • 574
RSullivan
  • 65
  • 7

2 Answers2

0

From the documentation, gdk_pixbuf_major_version is defined as:

extern const guint  gdk_pixbuf_major_version

And the description is:

The major version number of the gdk-pixbuf library. (e.g. in gdk-pixbuf version 1.2.5 this is 1.)

This variable is in the library, so represents the gdk-pixbuf library you have linked against. Contrast with the GDK_PIXBUF_MAJOR macro, which represents the major version of the gdk-pixbuf headers you have included.

José Fonte
  • 4,016
  • 2
  • 16
  • 28
0

This is not an answer

Well I have never gotten to the bottom of this. My undefined reference kept coming and going over the last week with no rhyme or reason with no changes in libraries (not adding or removing them) and no changes to the code that references GdkPixbuf's.

I have given up and am moving the whole thing to Cairo.

RSullivan
  • 65
  • 7