This forum has been archived. All content is frozen. Please use KDE Discuss instead.

Linker problem

Tags: None
(comma "," separated)
rainbowgoblin
Registered Member
Posts
21
Karma
0

Linker problem

Mon Oct 13, 2014 6:43 am
I'm a little rusty, so I suspect I'm doing something very stupid, but I'm having trouble linking to Marble. I've updated to the latest version available to my Arch Linux distribution, and I can't get an application to link against Marble. This is from a dummy application written for Qt4, using a qmake project file.

Specifically, I'm running into this error:

Code: Select all
mainwindow.cpp:(.text+0x2cc): undefined reference to `Marble::SearchRunnerManager::searchPlacemarks(QString const&, Marble::GeoDataLatLonAltBox const&, int)'


The linking command is:

Code: Select all
g++ -Wl,-O1,--sort-common,--as-needed,-z,relro -Wl,-O1 -o modal main.o mainwindow.o preferences.o moc_mainwindow.o moc_preferences.o    -L/usr/lib -lmarblewidget -lQtGui -lQtCore -lpthread


I've checked the library .so file using grep, and I do get a hit from searchPlacemarks, but somehow linking isn't working. Any ideas what I'm doing wrong? I'll post complete code if that'll help, but I'm guessing that given that given that the source file that includes the SearchRunnerManager.h header compiles just fine, my code is fine, it's something about how I'm compiling that's off.

Any ideas?
shentey
Registered Member
Posts
10
Karma
0
OS

Re: Linker problem  Topic is solved

Mon Oct 13, 2014 5:53 pm
It looks like you're including a different version of "SearchRunnerManager.h" than shipped with the library you're linking against. In KDE SC 4.14 the GeoDataLatLon*Alt*Box parameter changed to GeoDataLatLonBox, i.e. without "Alt".

HTH
rainbowgoblin
Registered Member
Posts
21
Karma
0

Re: Linker problem

Mon Oct 13, 2014 9:12 pm
Phew. I never would have spotted that.

I have different copies of the library/headers in /usr/{lib,include} and /usr/local{lib,include} because I'm playing with KDE4 and KDE5 in different versions of this project. Seemed like a good idea... why did I bother with different versions of the headers? In case the Arch repositories had an older version than the KDE5 version I had in /usr/local. Trouble is, I'm the slow one with the updates.

I guess I'll wrestle with my project file to make sure I'm including the right version of the headers. And update my KDE5 compile of Marble.

Thanks!


Bookmarks



Who is online

Registered users: Bing [Bot], daret, Google [Bot], Sogou [Bot]