LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 01-04-2005, 10:52 AM   #1
Zotty
LQ Newbie
 
Registered: Sep 2004
Location: Netherlands
Distribution: Debian testing
Posts: 25

Rep: Reputation: 15
DCOP undefined reference


I'm trying to use the DCOP interface, but there are some undefined references during the linking stage which I haven't been able to fix so far:

The error output
Code:
g++  -I/usr/include/kde -I/usr/share/qt3/include -I/usr/share/qt3/lib -I/usr/X11R6/include -I/usr/X11R6/lib -c queuehandler.cpp -o queuehandler.o
g++ -L/usr/lib -L/usr/share/qt3/lib -L/usr/X11R6/lib -lkdecore -lkdeui -lkio -lqt-mt -lXext -lX11 -o main main.o queuehandler.o
queuehandler.o(.gnu.linkonce.r._ZTV12QueueHandler+0x28): undefined reference to `DCOPIface::process(QCString const&, QMemArray<char> const&, QCString&, QMemArray<char>&)'
queuehandler.o(.gnu.linkonce.r._ZTV12QueueHandler+0x2c): undefined reference to `DCOPIface::functions()'
queuehandler.o(.gnu.linkonce.r._ZTV12QueueHandler+0x30): undefined reference to `DCOPIface::interfaces()'
queuehandler.o(.gnu.linkonce.r._ZTV12QueueHandler+0x64): undefined reference to `virtual thunk [v:0,-16] to DCOPIface::process(QCString const&, QMemArray<char> const&, QCString&, QMemArray<char>&)'
queuehandler.o(.gnu.linkonce.r._ZTV12QueueHandler+0x74): undefined reference to `virtual thunk [v:0,-32] to DCOPIface::interfaces()'
queuehandler.o(.gnu.linkonce.r._ZTV12QueueHandler+0x78): undefined reference to `virtual thunk [v:0,-36] to DCOPIface::functions()'
queuehandler.o(.gnu.linkonce.r._ZTC12QueueHandler0_9DCOPIface+0x18): undefined reference to `typeinfo for DCOPIface'
queuehandler.o(.gnu.linkonce.r._ZTC12QueueHandler0_9DCOPIface+0x24): undefined reference to `DCOPIface::process(QCString const&, QMemArray<char> const&, QCString&, QMemArray<char>&)'
queuehandler.o(.gnu.linkonce.r._ZTC12QueueHandler0_9DCOPIface+0x28): undefined reference to `DCOPIface::functions()'
queuehandler.o(.gnu.linkonce.r._ZTC12QueueHandler0_9DCOPIface+0x2c): undefined reference to `DCOPIface::interfaces()'
queuehandler.o(.gnu.linkonce.r._ZTC12QueueHandler0_9DCOPIface+0x54): undefined reference to `typeinfo for DCOPIface'
queuehandler.o(.gnu.linkonce.r._ZTC12QueueHandler0_9DCOPIface+0x60): undefined reference to `virtual thunk [v:0,-16] to DCOPIface::process(QCString const&, QMemArray<char> const&, QCString&, QMemArray<char>&)'
queuehandler.o(.gnu.linkonce.r._ZTC12QueueHandler0_9DCOPIface+0x70): undefined reference to `virtual thunk [v:0,-32] to DCOPIface::interfaces()'
queuehandler.o(.gnu.linkonce.r._ZTC12QueueHandler0_9DCOPIface+0x74): undefined reference to `virtual thunk [v:0,-36] to DCOPIface::functions()'
queuehandler.o(.gnu.linkonce.t._ZN9DCOPIfaceD0Ev+0xa): In function `DCOPIface::~DCOPIface [in-charge deleting]()':
: undefined reference to `vtable for DCOPIface'
queuehandler.o(.gnu.linkonce.t._ZN9DCOPIfaceD0Ev+0x19): In function `DCOPIface::~DCOPIface [in-charge deleting]()':
: undefined reference to `vtable for DCOPIface'
queuehandler.o(.gnu.linkonce.t._ZN9DCOPIfaceD1Ev+0xa): In function `DCOPIface::~DCOPIface [in-charge]()':
: undefined reference to `vtable for DCOPIface'
queuehandler.o(.gnu.linkonce.t._ZN9DCOPIfaceD1Ev+0x19): In function `DCOPIface::~DCOPIface [in-charge]()':
: undefined reference to `vtable for DCOPIface'
queuehandler.o(.gnu.linkonce.r._ZTI12QueueHandler+0x10): undefined reference to `typeinfo for DCOPIface'
collect2: ld returned 1 exit status
make: *** [main] Error 1
My basic DCOPIface class (only used to send)
Code:
#ifndef DCOPIFACE_H
#define DCOPIFACE_H

#include <dcopobject.h>

class DCOPIface : virtual public DCOPObject
{
    K_DCOP
    k_dcop:
};

#endif
And the only dcop code used so far
Code:
QueueHandler :: QueueHandler()
	: DCOPObject( "DCOPTest" )
{
	// Register with DCOP
	if ( !kapp->dcopClient()->isRegistered() ) {
		kapp->dcopClient()->registerAs( "DCOP Testing" );
		kapp->dcopClient()->setDefaultObject( objId() );
	}
}
Any idea's?

Last edited by Zotty; 01-04-2005 at 10:54 AM.
 
Old 01-04-2005, 07:40 PM   #2
leonscape
Senior Member
 
Registered: Aug 2003
Location: UK
Distribution: Debian SID / KDE 3.5
Posts: 2,313

Rep: Reputation: 48
This looks like a missing lib, what libs have you set to compile against?

Also have you added in the .skel file to your Makefile.am?

Checkout tutorial
 
Old 01-06-2005, 09:30 AM   #3
Zotty
LQ Newbie
 
Registered: Sep 2004
Location: Netherlands
Distribution: Debian testing
Posts: 25

Original Poster
Rep: Reputation: 15
The missing lib what I thought aswell, but which one? I've tried a bunch of libkde*** libraries, but no luck.

There's my makefile
Code:
CC			= g++

DCOPIDL		= /usr/bin/dcopidl
DCOPIDL2CPP	= /usr/bin/dcopidl2cpp
DCOPIDLNG	= /usr/bin/dcopidlng
KDE_INCLUDES = -I/usr/include/kde
KDE_LDFLAGS = -L/usr/lib
QT_INCLUDES	= -I/usr/share/qt3/include
QT_LDFLAGS	= -I/usr/share/qt3/lib
X_INCLUDES	= -I/usr/X11R6/include
X_LDFLAGS	= -I/usr/X11R6/lib

INCLUDES = -I/usr/include/kde -I/usr/share/qt3/include -I/usr/share/qt3/lib -I/usr/X11R6/include -I/usr/X11R6/lib
LIBS =  -L/usr/lib -L/usr/share/qt3/lib -L/usr/X11R6/lib -lkdecore -lkdeui -lkio -lqt-mt -lXext -lX11

CFLAGS		=
PREFIX		= /usr
OBJECTS 	= main.o queuehandler.o

all: main

main: $(OBJECTS)
	$(CC) $(LIBS) -o $@ $(OBJECTS)

.cpp.o:
	$(CC) $(CFLAGS) $(INCLUDES) -c $< -o $@

clean:
	rm -f *.o
I've also read several tutorials, but no answer there... May be a silly question, but what's a .skel file for? Never heard of those before (I'm a starting Linux developer ), although I've seen the term pop up (also in the tutorial you linked to).

Last edited by Zotty; 01-06-2005 at 09:32 AM.
 
Old 01-06-2005, 01:38 PM   #4
leonscape
Senior Member
 
Registered: Aug 2003
Location: UK
Distribution: Debian SID / KDE 3.5
Posts: 2,313

Rep: Reputation: 48
The skel file is created automatically by dcopidl when it processes the DCOP interface definition.

The best way to create KDE apps is to use the Automake setup provided for KDE, either in the kdesdk module, or through KDevelop.
This will setup the moc, and most of the libs for you. It means your only having to work on a Makefile.am rather than writing your own
makefiles, and configuration. Plus stuff like processing dcopidl will work rather easily. A couple of links for you:

KDE Developers Corner
KDE Libs API
Qt Libs API
 
Old 01-06-2005, 04:40 PM   #5
Zotty
LQ Newbie
 
Registered: Sep 2004
Location: Netherlands
Distribution: Debian testing
Posts: 25

Original Poster
Rep: Reputation: 15
Well, I guess I'll have to do some more reading and experimenting then

On the other hand, there's a simple reason why I've made my own makefile; I don't like working with KDevelop. Hence I'd still like to find out how to get this to work (by hand).

In any case, thanks for the links. I'll check them out asap and stuff the info in some braincells!.
 
Old 01-06-2005, 04:47 PM   #6
leonscape
Senior Member
 
Registered: Aug 2003
Location: UK
Distribution: Debian SID / KDE 3.5
Posts: 2,313

Rep: Reputation: 48
I'd still recommend getting the kdesdk, with the Makefile and configuration scripts ( and basic templates for KDE porgrams ), it will make your life a lot easier.
 
Old 01-06-2005, 05:04 PM   #7
Zotty
LQ Newbie
 
Registered: Sep 2004
Location: Netherlands
Distribution: Debian testing
Posts: 25

Original Poster
Rep: Reputation: 15
I'll promise to check it out. Can't be wrong to broaden one's horizon now and then.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Undefined reference, why? george_mercury Programming 4 05-07-2009 12:15 AM
KDevelop: undefined reference bastl Programming 2 09-05-2005 09:52 AM
Undefined Reference ChemicalBurn Programming 2 02-14-2005 03:01 AM
undefined reference mp4-10 Programming 3 01-25-2005 12:38 PM
undefined reference error Quest101 Programming 3 01-01-2005 12:27 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 11:38 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration