PDA

View Full Version : undefined reference to QObject



hcerny
2nd May 2008, 16:42
Hi

I've coded an application under windows and am now having a hard getting it to run under linux. Under windows it runs and compiles fine.

management.o: In function `Management::Management(QCoreApplication*)':
management.cpp:(.text+0x7d): undefined reference to `QObject::QObject(QObject const&)'
management.o: In function `Management::Management(QCoreApplication*)':
management.cpp:(.text+0x2e3): undefined reference to `QObject::QObject(QObject const&)'

is the error I'm getting from the linker. The management is the class I'm calling from main().

Any ideas?

aamer4yu
2nd May 2008, 16:47
Is this error or warning...
can u show the code which is giving error ?

hcerny
2nd May 2008, 16:55
Doesn't say; next line is "collect2: ld returned 1 exit status" though, so I'm guessing it's an error.

I don't actually know what part of the code is causing the error. Those hex numbers don't translate to line numbers in the source file. I don't have any calls to Object-anything; only thing are some connect()s.

management.cpp is part of a larger project. There are a lot of Qt related includes and up to the linking I'm not getting any errors.