PDA

View Full Version : Compiling error with wwWidtes.qt 4.6.2



Andrewshkovskii
19th May 2010, 18:02
Hello all!
i build wwwidgets like this :
qmake -spec win32-g++ -r CONFIG+=release,
Mingw32-make-install.
and now i got a problem with compiling simple project with wwWidgets :
.pro

TEMPLATE = app
SOURCES += main.cpp
CONFIG += wwwidgets


#include <QtGui/QApplication>
#include <QwwTwoColorIndicator>

int main(int argc, char *argv[])
{
QApplication a(argc, argv);
QwwTwoColorIndicator id;
id.show();
return a.exec();
}

buildind in release. So, i got error message :

testWWW/../../Qt/include/wwWidgets/qwwtwocolorindicator.h:21: undefined reference to `QwwPrivatable::~QwwPrivatable()'
But QwwPrivatable is defined in #include <wwglobal.h> witch is including in all qww classes.
Why is happening and what i'am doing wrong?
Because every example coming with wwWidgets is compiling, cleaning and re-building and qmake'ing as well, as normal project.

wysota
19th May 2010, 21:12
Is this the only error you are getting?

Andrewshkovskii
19th May 2010, 21:38
Hello, Wysota:)
yes, it is only compilation i get, but i cant understand, why wwW examples are compiling, my projects - not?

wysota
19th May 2010, 22:02
I would guess you are not linking with the library but it's just a guess. Could you provide the whole compilation log for your project (please attach it as a file to your post)?

Andrewshkovskii
19th May 2010, 22:23
here it is!

wysota
19th May 2010, 23:17
Could you post the complete project here so that I can try to reproduce the problem myself? Either the log is mixed up or the project builds and then something fails but I need to see the actual code, maybe there is a bug in wwWidgets.

Andrewshkovskii
19th May 2010, 23:40
It's very simple code, with one your widget at all.. May be i build and install wwWidgets wrong or something?

wysota
20th May 2010, 09:14
It compiles without problems on my machine (after removing the incorrect include from main.cpp, of course). How exactly did you install wwWidgets? Do you have the latest version (0.9.6)?

Andrewshkovskii
20th May 2010, 11:12
#include "C:\storage\programming\wwWidgets\widgets\wwglobal_ p.h"
this incorrect include? ok, i removed it, but nothing happened.
I removed widgets and re-install them now by :

C:\storage\programming\wwWidgets>qmake wwwidgets4.pro -spec win32-g++ -r CONFIG
+=release
Reading C:/storage/programming/wwWidgets/widgets/widgets.pro
Reading C:/storage/programming/wwWidgets/plugin/plugin.pro

C:\storage\programming\wwWidgets>mingw32-make

And now i get this make error

g++ -c -O2 -Wall -frtti -fexceptions -mthreads -DUNICODE -DQT_LARGEFILE_SUPPORT
-DWW_NO_BREADCRUMB -DQT_DLL -DQT_NO_DEBUG -DQT_PLUGIN -DQT_SCRIPT_LIB -DQT_XML_L
IB -DQT_GUI_LIB -DQT_CORE_LIB -DQDESIGNER_EXPORT_WIDGETS -DQT_THREAD_SUPPORT -I"
..\..\Qt\include\QtDesigner" -I"..\..\Qt\include\QtCore" -I"..\..\Qt\include\QtG
ui" -I"..\..\Qt\include\QtXml" -I"..\..\Qt\include\QtScript" -I"..\..\Qt\include
" -I"..\widgets\qwwcolorbutton" -I"..\widgets\qwwcolorcombobox" -I"..\widgets\qw
wconfigwidget" -I"..\widgets\qwwhuesatpicker" -I"..\widgets\qwwhuesatradialpicke
r" -I"..\widgets\qwwlistwidget" -I"..\widgets\qwwlongspinbox" -I"..\widgets\qwwn
avigationbar" -I"..\widgets\qwwnumpad" -I"..\widgets\qwwrichtextbutton" -I"..\wi
dgets\qwwtaskpanel" -I"..\widgets\qwwtextspinbox" -I"..\widgets\qwwtipwidget" -I
"..\widgets\qwwtwocolorindicator" -I"..\widgets\qwwfilechooser" -I"..\widgets\qw
wloginbox" -I"..\widgets\qwwbuttonlineedit" -I"..\widgets\qwwclearlineedit" -I".
.\widgets\qwwresetlineedit" -I"..\widgets\qwwrichtextedit" -I"..\widgets\qwwlist
navigator" -I"..\widgets\qwwled" -I"..\widgets" -I"." -I"..\..\Qt\include\Active
Qt" -I"release" -I"." -I"..\..\Qt\mkspecs\win32-g++" -o release\moc_qwwlediface.
o release\moc_qwwlediface.cpp
g++ -enable-stdcall-fixup -Wl,-enable-auto-import -Wl,-enable-runtime-pseudo-rel
oc -Wl,-s -mthreads -Wl -shared -Wl,--out-implib,release\libwwwidgetsplugin.a -o
release\wwwidgetsplugin.dll object_script.wwwidgetsplugin.Release -L"c:\storag
e\programming\Qt\lib" -L../widgets/release -lwwwidgets4 -L../widgets/debug -lwww
idgets4d -lQtScript4 -lQtXml4 -lQtGui4 -lQtCore4 -lQtDesigner4
c:/storage/programming/mingw/bin/../lib/gcc/mingw32/4.4.1-dw2/../../../../mingw3
2/bin/ld.exe: cannot find -lwwwidgets4d
collect2: ld returned 1 exit status
mingw32-make[2]: *** [release\wwwidgetsplugin.dll] Error 1
mingw32-make[2]: Leaving directory `C:/storage/programming/wwWidgets/plugin'
mingw32-make[1]: *** [release] Error 2
mingw32-make[1]: Leaving directory `C:/storage/programming/wwWidgets/plugin'
mingw32-make: *** [sub-plugin-make_default-ordered] Error 2
So, i copy wwwidgets4.dll, rename it to wwwidgets4d, and put it into

...\wwWidgets\widgets\debug and ..\wwWidgets\widgets\release
and run make again, after make finished, i installed wwwidgets (make-install) and it installed.
So, i think the compilation error was caused becouse of my actions with *.dll files.

Andrewshkovskii
20th May 2010, 12:38
I fixed this error with adding CONFIG-=debug to plugin.pro, and run mingw32-make , mingw32-make install again, so it compiled
But project compiling is failed again with message :

mingw32-make: Entering directory `C:/storage/programming/workspace/testWWW'
C:/storage/programming/MinGW/bin/mingw32-make -f Makefile.Release
mingw32-make[1]: Entering directory `C:/storage/programming/workspace/testWWW'
g++ -c -O2 -frtti -fexceptions -mthreads -Wall -DUNICODE -DQT_LARGEFILE_SUPPORT -DWWWIDGETS -DQT_DLL -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -DQT_THREAD_SUPPORT -DQT_NEEDS_QMAIN -I"..\..\Qt\include\QtCore" -I"..\..\Qt\include\QtGui" -I"..\..\Qt\include" -I"..\..\Qt\include\wwWidgets" -I"..\..\Qt\include\ActiveQt" -I"release" -I"..\..\Qt\mkspecs\win32-g++" -o release\main.o main.cpp
g++ -enable-stdcall-fixup -Wl,-enable-auto-import -Wl,-enable-runtime-pseudo-reloc -Wl,-s -mthreads -Wl -Wl,-subsystem,windows -o release\testWWW.exe release/main.o -L"c:\storage\programming\Qt\lib" -lmingw32 -lqtmain -lwwwidgets4 -lQtGui4 -lQtCore4
mingw32-make[1]: Leaving directory `C:/storage/programming/workspace/testWWW'
mingw32-make: Leaving directory `C:/storage/programming/workspace/testWWW'
release/main.o:main.cpp:(.text+0x72): undefined reference to `QwwPrivatable::~QwwPrivatable()'
release/main.o:main.cpp:(.text+0xce): undefined reference to `QwwPrivatable::~QwwPrivatable()'
collect2: ld returned 1 exit status
mingw32-make[1]: *** [release\testWWW.exe] Error 1
mingw32-make: *** [release] Error 2
And designer say's that wwwidgetsplugin.dll could not be found/loaded, but wwwidgetsplugin.dll is in /Qt/plugins/designer/ directory.

wysota
20th May 2010, 14:10
Start from scratch, unpack the archive, cd into the "widgets" directory, run qmake, run make, run make install, cd ../plugin, run qmake, run make, run make install. Everything should be fine then - it's a foulproof method of installing this particular widget set - it should create a debug and release version of the widget set and release version of the designer plugin.

Andrewshkovskii
20th May 2010, 14:56
Start from scratch, unpack the archive, cd into the "widgets" directory, run qmake, run make, run make install, cd ../plugin, run qmake, run make, run make install. Everything should be fine then - it's a foulproof method of installing this particular widget set - it should create a debug and release version of the widget set and release version of the designer plugin.

I made everything as you say..."widgets" directory compiled perfect. But plugin.. is it need to fix plugin.pro, and change

win32 {
CONFIG(release): LIBS += -L../widgets/release -lwwwidgets4
CONFIG(debug): LIBS += -L../widgets/debug -lwwwidgets4d
}

to

win32 {
CONFIG(release): LIBS += -L../widgets/release -lwwwidgets4
CONFIG(debug): LIBS += -L../widgets/debug -lwwwidgets4
}

If not, there is still error with linker : cannot find lwwwidgets4d..
After i changed plugin.pro file, and everything compiled perfect..Designer plugin work correctly, examples are compiling...but i i still got the compilation error with that first simple project, what i showed early, with QwwPrivatable error...


mingw32-make: Entering directory `C:/storage/programming/workspace/testWWW'
C:/storage/programming/MinGW/bin/mingw32-make -f Makefile.Release
mingw32-make[1]: Entering directory `C:/storage/programming/workspace/testWWW'
g++ -c -O2 -frtti -fexceptions -mthreads -Wall -DUNICODE -DQT_LARGEFILE_SUPPORT -DWWWIDGETS -DQT_DLL -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -DQT_THREAD_SUPPORT -DQT_NEEDS_QMAIN -I"..\..\Qt\include\QtCore" -I"..\..\Qt\include\QtGui" -I"..\..\Qt\include" -I"..\..\Qt\include\wwWidgets" -I"..\..\Qt\include\ActiveQt" -I"release" -I"..\..\Qt\mkspecs\win32-g++" -o release\main.o main.cpp
g++ -enable-stdcall-fixup -Wl,-enable-auto-import -Wl,-enable-runtime-pseudo-reloc -Wl,-s -mthreads -Wl -Wl,-subsystem,windows -o release\testWWW.exe release/main.o -L"c:\storage\programming\Qt\lib" -lmingw32 -lqtmain -lwwwidgets4 -lQtGui4 -lQtCore4
mingw32-make[1]: Leaving directory `C:/storage/programming/workspace/testWWW'
mingw32-make: Leaving directory `C:/storage/programming/workspace/testWWW'
release/main.o:main.cpp:(.text+0x72): undefined reference to `QwwPrivatable::~QwwPrivatable()'
release/main.o:main.cpp:(.text+0xce): undefined reference to `QwwPrivatable::~QwwPrivatable()'
collect2: ld returned 1 exit status
mingw32-make[1]: *** [release\testWWW.exe] Error 1
mingw32-make: *** [release] Error 2

Maybe this is because of my version of Qt? My version is 4.6.2 Open source...

wysota
20th May 2010, 16:36
Maybe you should make a similar fix in wwwidgets.prf.

Andrewshkovskii
20th May 2010, 16:49
Maybe you should make a similar fix in wwwidgets.prf.
No..this is not working too..

//
// C++ Implementation: main
//
// Description:
//
//
// Author: Witold Wysota <wysota@wysota.eu.org>, (C) 2008
//
// Copyright: See COPYING file that comes with this distribution
//
//

//#include "ui_colorpickers.h"
#include <qwwtwocolorindicator.h>
#include <QApplication>

int main(int argc, char **argv){
QApplication app(argc, argv);
QwwTwoColorIndicator w;
w.show();
return app.exec();
}

and i got... :

mingw32-make: Entering directory `C:/storage/programming/wwWidgets/examples/colorpickers'
C:/storage/programming/MinGW/bin/mingw32-make -f Makefile.Release
mingw32-make[1]: Entering directory `C:/storage/programming/wwWidgets/examples/colorpickers'
c:\storage\programming\Qt\bin\uic.exe colorpickers.ui -o ui_colorpickers.h
g++ -c -O2 -frtti -fexceptions -mthreads -Wall -DUNICODE -DQT_LARGEFILE_SUPPORT -DWWWIDGETS -DQT_DLL -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -DQT_THREAD_SUPPORT -DQT_NEEDS_QMAIN -I"..\..\..\Qt\include\QtCore" -I"..\..\..\Qt\include\QtGui" -I"..\..\..\Qt\include" -I"..\..\..\Qt\include\wwWidgets" -I"..\..\..\Qt\include\ActiveQt" -I"release" -I"." -I"..\..\..\Qt\mkspecs\win32-g++" -o release\main.o main.cpp
g++ -enable-stdcall-fixup -Wl,-enable-auto-import -Wl,-enable-runtime-pseudo-reloc -Wl,-s -mthreads -Wl -Wl,-subsystem,windows -o release\colorpickers.exe release/main.o -L"c:\storage\programming\Qt\lib" -lmingw32 -lqtmain -lwwwidgets4 -lQtGui4 -lQtCore4
mingw32-make[1]: Leaving directory `C:/storage/programming/wwWidgets/examples/colorpickers'
mingw32-make: Leaving directory `C:/storage/programming/wwWidgets/examples/colorpickers'
release/main.o:main.cpp:(.text+0x72): undefined reference to `QwwPrivatable::~QwwPrivatable()'
release/main.o:main.cpp:(.text+0xce): undefined reference to `QwwPrivatable::~QwwPrivatable()'
collect2: ld returned 1 exit status
mingw32-make[1]: *** [release\colorpickers.exe] Error 1
mingw32-make: *** [release] Error 2

Wysota, did you tested your widgets with qt 4.6.2?
I think it's time me to reinstall mingw, qt... :/

wysota
20th May 2010, 17:09
I tested the widgets two hours ago against 4.6.2, only on Linux unfortunately but this shouldn't have to do anything with the platform used. MinGW doesn't have to do anything with this as well. The problem is clearly in wwWidgets. I'll try to reproduce it on Windows in upcoming days and find a fix for it. Until then you have to be patient or try to find a solution on your own.

You can try this:

open wwglobal.h, and change:

class QwwPrivatable {
to

class Q_WW_EXPORT QwwPrivatable {
Then recompile and reinstall wwWidgets. Let me know if it helps.

Andrewshkovskii
20th May 2010, 20:03
I tested the widgets two hours ago against 4.6.2, only on Linux unfortunately but this shouldn't have to do anything with the platform used. MinGW doesn't have to do anything with this as well. The problem is clearly in wwWidgets. I'll try to reproduce it on Windows in upcoming days and find a fix for it. Until then you have to be patient or try to find a solution on your own.

You can try this:

open wwglobal.h, and change:

class QwwPrivatable {
to

class Q_WW_EXPORT QwwPrivatable {
Then recompile and reinstall wwWidgets. Let me know if it helps.

Em..with those changes designer fail to load plugin .dll file, and application compile, but when i run it, it exiting with code -1073741515

wysota
20th May 2010, 20:24
Either uninstall the wwWidgets library before recompiling or make sure you first compile and install the widget library and only then compile and install the plugin. Also check what is the error Designer reports about the plugin.

Andrewshkovskii
20th May 2010, 20:35
Ok, just see my steps, mb i'am doing something wrong?
1 - deleting wwWidgets directory.
2 - deleting wwWidgets files from Qt directory.
3 - unpack wwWidgets-0.9.6.tar.gz (C:\storage\programming, not %QtDIR%).
4 - fix plugin.pro file, change

win32 {
CONFIG(release): LIBS += -L../widgets/release -lwwwidgets4
CONFIG(debug): LIBS += -L../widgets/debug -lwwwidgets4d
}
to

win32 {
CONFIG(release): LIBS += -L../widgets/release -lwwwidgets4
CONFIG(debug): LIBS += -L../widgets/debug -lwwwidgets4
}
5 - fix wwglobal.h (did the wwglobal_p.h need to fix too?)
6 - cd "widgets" - qmake, make, make install.
7 - cd "plugin" - qmake, make, make install.
Try to launch Designer -> the wwwidgetplugin.dll could not to be founded (but it in the qt/plugin/designer DIR)
..Oh god.. i think i'am damned....
May be something wrong with my %path% ?
And one moment... why make did not build debug version of wwwidget4 library?

wysota
20th May 2010, 20:55
5 - fix wwglobal.h (did the wwglobal_p.h need to fix too?)
No, wwglobal_p.h is ok as it is for sure. It's a private header file which shouldn't export anything.


Try to launch Designer -> the wwwidgetplugin.dll could not to be founded (but it in the qt/plugin/designer DIR)
But what exactly cannot be found? wwWidgets are surely not to be blamed in this case :)

Andrewshkovskii
20th May 2010, 20:59
wait a sec, i will show you screenshot :)
Oh, sorry, here is normal size image http://img39.imageshack.us/img39/331/wwwidgets.png

Btw, my %path% :

C:\Documents and Settings\Administrator\My Documents\Borland Studio Projects\Bpl;%SystemRoot%\system32;%SystemRoot%;%S ystemRoot%\System32\Wbem;C:\storage\programming\Mi nGW;C:\storage\programming\MinGW\bin;C:\storage\pr ogramming\Python26;C:\storage\programming\python26 \scripts;C:\storage\programming\Qt\bin;

Andrewshkovskii
20th May 2010, 21:22
I can't understand why it happening, even if i dont fix the wwglobal.h, e.w. they( wwWidgets )are not installed, when five hours ago, they installed, but the projects were not compiling. miracle's...:mad:

wysota
20th May 2010, 21:44
Ok, here is what I did.


I have a fresh install of Windows 2000 which doesn't support Qt SDK, so I downloaded Qt for Mingw and Mingw and installed both.
Then I downloaded and unpacked wwWidgets.
I opened Qt command prompt, changed directory to the one containing sources.
In Wordpad (you can use any other text editor you want) I opened plugin.pro and removed the offending "d" from the name of the library. Actually I think a better approach is to change the filename of the dll once it is compiled to contain this "d" as it is quite important later on.
I ran qmake and make, everything compiled (actually it failed because in reality I didn't remove the "d" earlier but the order is irrelevant).
I ran make install.
I copied wwwidgets4.dll from %QTDIR%/lib to %QTDIR%/bin
I started Designer - and the widgets were available
Then I tried to compile some example (colorpickers) but it failed during linking phase. It didn't complain about QwwPrivatable but rather about something in MinGW (I think my MinGW might be too old):

c:\Qt\4.6.2\lib/libqtmain.a(qtmain_win.o):qtmain_win.cpp:(.text+0x 1c2): undefined reference to `_Unwind_Resume'
c:\Qt\4.6.2\lib/libqtmain.a(qtmain_win.o):qtmain_win.cpp:(.text$_Z N7QVectorIPcE7
reallocEii[QVector<char*>::realloc(int, int)]+0x187): undefined reference to `_Unwind_Resume'
c:\Qt\4.6.2\lib/libqtmain.a(qtmain_win.o):qtmain_win.cpp:(.eh_fram e+0x12): undefined reference to `__gxx_personality_v0'


I hope that helps you at least a bit. I'll try to improve the compilation process to avoid such problems in the next release.

Andrewshkovskii
20th May 2010, 21:55
the designer problem was in

I copied wwwidgets4.dll from %QTDIR%/lib to %QTDIR%/bin.
Tomorrow i will try to re-install Qt,mingw, and , mb, Windows :) and try again!
Anyway, Thank you , Wysota.

Andrewshkovskii
20th May 2010, 22:07
Omg, i did that! But wwwidgets work only in release mode now..Oh, it was longest journey..
The fix was in :
Fixing the qwwglobal.h
Making copy of wwwidgets4.dll (wwwidgets4D.dll)
Adding wwwidgets4.dll to %QTDIR%\bin.
Adding to %PATH% %wwWidgetsDIR%\widgets;
Compiling in release mode..
But creator dont see the includes by <>, only ""