jhearon
21st July 2007, 05:43
Hi,
I've read the previous thread with vtable problem. I'm having a similar problem.
Fedora Core 6, QT 4.3, Fedora Eclipse with GCC.
I have QT 3.3 from the Fedora System install still in /usr/include/qt-3.3, but have pointed everything in my Eclipse project towards QT 4 includes and libs (/usr/include/qt4). I also have the env variables QTDIR, QTLIB, and QTINC pointed towards Qt4, and have Qt4 at the head of the PATH.
In addition I can compile the QT tutorials against QT4 using qmake, say on t1.pro, then make.
But when I try to compile in Fedora Eclipse using GCC in a CPP project I get a linker error:
undefined reference to `vtable for Window' etc.
The .cpp files compile, but the linker gives up. Below is what I have for my -L and -l commands. I've also tried using qmake to generate a makefile, and then model my IDE proj settings off those, but seems like I'm still missing a lib or have something incorrect.
Thanks for any help or info.
make -k all
Building target: QTwidget1
Invoking: GCC C++ Linker
g++ -L/usr -L/usr/bin -L/usr/lib -L/usr/lib/qt4 -L/usr/lib/qt4/lib -L/usr/lib/qt4/bin -o"QTwidget1" ./coinwidget.o ./main.o ./model.o ./window.o -lCoin -lSoQt -lsimage -lGL -lGLU -lQtOpenGL -lQtGui -lQtCore -lQt3Support
./coinwidget.o: In function `~CoinWidget':
/home/JCH/workspaceSoGui_SoQt/QTwidget1_qt4/Debug/../coinwidget.cpp:22: undefined reference to `vtable for CoinWidget'
/home/JCH/workspaceSoGui_SoQt/QTwidget1_qt4/Debug/../coinwidget.cpp:22: undefined reference to `vtable for CoinWidget'
/home/JCH/workspaceSoGui_SoQt/QTwidget1_qt4/Debug/../coinwidget.cpp:22: undefined reference to `vtable for CoinWidget'
/home/JCH/workspaceSoGui_SoQt/QTwidget1_qt4/Debug/../coinwidget.cpp:22: undefined reference to `vtable for CoinWidget'
/home/JCH/workspaceSoGui_SoQt/QTwidget1_qt4/Debug/../coinwidget.cpp:22: undefined reference to `vtable for CoinWidget'
./coinwidget.o:/home/JCH/workspaceSoGui_SoQt/QTwidget1_qt4/Debug/../coinwidget.cpp:22: more undefined references to `vtable for CoinWidget' follow
./main.o: In function `~Window':
/home/JCH/workspaceSoGui_SoQt/QTwidget1_qt4/Debug/../window.h:15: undefined reference to `vtable for Window'
/home/JCH/workspaceSoGui_SoQt/QTwidget1_qt4/Debug/../window.h:15: undefined reference to `vtable for Window'
./window.o: In function `Window':
/home/JCH/workspaceSoGui_SoQt/QTwidget1_qt4/Debug/../window.cpp:5: undefined reference to `vtable for Window'
/home/JCH/workspaceSoGui_SoQt/QTwidget1_qt4/Debug/../window.cpp:5: undefined reference to `vtable for Window'
/home/JCH/workspaceSoGui_SoQt/QTwidget1_qt4/Debug/../window.cpp:5: undefined reference to `vtable for Window'
./window.o:/home/JCH/workspaceSoGui_SoQt/QTwidget1_qt4/Debug/../window.cpp:5: more undefined references to `vtable for Window' follow
./window.o: In function `Window::tr(char const*, char const*)':
/home/JCH/workspaceSoGui_SoQt/QTwidget1_qt4/Debug/../window.h:16: undefined reference to `Window::staticMetaObject'
collect2: ld returned 1 exit status
make: *** [QTwidget1] Error 1
make: Target `all' not remade because of errors.
Build complete for project QTwidget1_qt4
I've read the previous thread with vtable problem. I'm having a similar problem.
Fedora Core 6, QT 4.3, Fedora Eclipse with GCC.
I have QT 3.3 from the Fedora System install still in /usr/include/qt-3.3, but have pointed everything in my Eclipse project towards QT 4 includes and libs (/usr/include/qt4). I also have the env variables QTDIR, QTLIB, and QTINC pointed towards Qt4, and have Qt4 at the head of the PATH.
In addition I can compile the QT tutorials against QT4 using qmake, say on t1.pro, then make.
But when I try to compile in Fedora Eclipse using GCC in a CPP project I get a linker error:
undefined reference to `vtable for Window' etc.
The .cpp files compile, but the linker gives up. Below is what I have for my -L and -l commands. I've also tried using qmake to generate a makefile, and then model my IDE proj settings off those, but seems like I'm still missing a lib or have something incorrect.
Thanks for any help or info.
make -k all
Building target: QTwidget1
Invoking: GCC C++ Linker
g++ -L/usr -L/usr/bin -L/usr/lib -L/usr/lib/qt4 -L/usr/lib/qt4/lib -L/usr/lib/qt4/bin -o"QTwidget1" ./coinwidget.o ./main.o ./model.o ./window.o -lCoin -lSoQt -lsimage -lGL -lGLU -lQtOpenGL -lQtGui -lQtCore -lQt3Support
./coinwidget.o: In function `~CoinWidget':
/home/JCH/workspaceSoGui_SoQt/QTwidget1_qt4/Debug/../coinwidget.cpp:22: undefined reference to `vtable for CoinWidget'
/home/JCH/workspaceSoGui_SoQt/QTwidget1_qt4/Debug/../coinwidget.cpp:22: undefined reference to `vtable for CoinWidget'
/home/JCH/workspaceSoGui_SoQt/QTwidget1_qt4/Debug/../coinwidget.cpp:22: undefined reference to `vtable for CoinWidget'
/home/JCH/workspaceSoGui_SoQt/QTwidget1_qt4/Debug/../coinwidget.cpp:22: undefined reference to `vtable for CoinWidget'
/home/JCH/workspaceSoGui_SoQt/QTwidget1_qt4/Debug/../coinwidget.cpp:22: undefined reference to `vtable for CoinWidget'
./coinwidget.o:/home/JCH/workspaceSoGui_SoQt/QTwidget1_qt4/Debug/../coinwidget.cpp:22: more undefined references to `vtable for CoinWidget' follow
./main.o: In function `~Window':
/home/JCH/workspaceSoGui_SoQt/QTwidget1_qt4/Debug/../window.h:15: undefined reference to `vtable for Window'
/home/JCH/workspaceSoGui_SoQt/QTwidget1_qt4/Debug/../window.h:15: undefined reference to `vtable for Window'
./window.o: In function `Window':
/home/JCH/workspaceSoGui_SoQt/QTwidget1_qt4/Debug/../window.cpp:5: undefined reference to `vtable for Window'
/home/JCH/workspaceSoGui_SoQt/QTwidget1_qt4/Debug/../window.cpp:5: undefined reference to `vtable for Window'
/home/JCH/workspaceSoGui_SoQt/QTwidget1_qt4/Debug/../window.cpp:5: undefined reference to `vtable for Window'
./window.o:/home/JCH/workspaceSoGui_SoQt/QTwidget1_qt4/Debug/../window.cpp:5: more undefined references to `vtable for Window' follow
./window.o: In function `Window::tr(char const*, char const*)':
/home/JCH/workspaceSoGui_SoQt/QTwidget1_qt4/Debug/../window.h:16: undefined reference to `Window::staticMetaObject'
collect2: ld returned 1 exit status
make: *** [QTwidget1] Error 1
make: Target `all' not remade because of errors.
Build complete for project QTwidget1_qt4