PDA

View Full Version : linking error while implementing QMotifStyle



lzha022
9th July 2008, 03:48
Hi,
I posted a question before.
http://www.qtcentre.org/forum/f-qt-designer-3/t-how-to-change-backgroup-color-button-color-and-shape-14111.html#post72928

Since it is really hard to change the button shape, so i would like to try a different style to see how the buttons look like.
But after i changed QWindowsStyle to QMotifStyle, i got lots of linking errors. I posted a few errors
cim error LNK2001: unresolved external symbol "__declspec(dllimport) public: __thiscall QMotifStyle::QMotifStyle(bool)" (__imp_??0QMotifStyle@@QAE@_N@Z)
cim error LNK2001: unresolved external symbol "__declspec(dllimport) public: __thiscall QMotifStyle::QMotifStyle(bool)" (__imp_??0QMotifStyle@@QAE@_N@Z)
cim error LNK2001: unresolved external symbol "__declspec(dllimport) public: virtual __thiscall QMotifStyle::~QMotifStyle(void)" (__imp_??1QMotifStyle@@UAE@XZ)
cim error LNK2001: unresolved external symbol "__declspec(dllimport) public: virtual bool __thiscall QMotifStyle::qt_emit(int,struct QUObject *)" (__imp_?qt_emit@QMotifStyle@@UAE_NHPAUQUObject@@@Z )
cim error LNK2001: unresolved external symbol "__declspec(dllimport) public: virtual bool __thiscall QMotifStyle::qt_invoke(int,struct QUObject *)" (__imp_?qt_invoke@QMotifStyle@@UAE_NHPAUQUObject@@ @Z)


.Could anyone please tell me what to do to fix these errors.

Thanks.

wysota
9th July 2008, 04:48
Where did you change QWindowsStyle to QMotifStyle?

lzha022
9th July 2008, 21:56
Where did you change QWindowsStyle to QMotifStyle?

I changed all the appearances of QWindowsStyle to QMotifStyle in the file myStyle.cpp which was attached in my previous post. Here is the link
http://www.qtcentre.org/forum/f-qt-designer-3/t-how-to-change-backgroup-color-button-color-and-shape-14111.html#post72928

jpn
10th July 2008, 21:04
What does


qDebug() << QStyleFactory::keys();

output?

lzha022
11th July 2008, 05:46
What does


qDebug() << QStyleFactory::keys();

output?

Hi,
Thank you for the reply. i put this line qDebug() << QStyleFactory::keys(); in my code, it gives error C2660: 'qDebug' : function does not take 0 arguments.
After i changed the code to qDebug(0) << QStyleFactory::keys(); , it gives another error
error C2678: binary '<<' : no operator found which takes a left-hand operand of type 'void' (or there is no acceptable conversion).
could you please tell me how to fix the errors?

jpn
11th July 2008, 08:03
Try including the header:

#include <QtDebug>

lzha022
13th July 2008, 22:34
Try including the header:

#include <QtDebug>

Hi,
I am using qt3.3.5, is QtDebug available in this version?
Do you what other styles available in this version?
Thanks

jpn
14th July 2008, 07:28
I am using qt3.3.5, is QtDebug available in this version?
Sorry, I missed that.


Do you what other styles available in this version?
That's what I'm trying to get outputted. :)

Anyway, QStyleFactory::keys() exists in Qt 3 too, just print each key by hand. It will print all available styles. Perhaps you don't have such style compiled in your library...

lzha022
15th July 2008, 00:45
Hi ,
Here is the output i get. So this means i do have Motif style. I just want to try a different style other than windows to see how it looks like. What other style do you recommend?

MotifPlus
Platinum
Motif
SGI
CDE
Windows

Thanks

wysota
15th July 2008, 07:51
To see how the application looks like with another style, you don't have to recompile your code. Simply execute your application with a "-style motif" switch.

lzha022
15th July 2008, 22:40
To see how the application looks like with another style, you don't have to recompile your code. Simply execute your application with a "-style motif" switch.

Could you please tell me how to swith that? -Sorry i am not very familiar with QT, and i am using QT with .NET
Will it switch motif on even if i have applied myStyle which implemented from WindowsStyle?

wysota
15th July 2008, 23:05
It has nothing to do with Qt or .NET or whatever else framework you might be using :) I meant you have to run your application with a "-style motif" parameter passed from within a shortcut or the command line.

lzha022
16th July 2008, 03:14
It has nothing to do with Qt or .NET or whatever else framework you might be using :) I meant you have to run your application with a "-style motif" parameter passed from within a shortcut or the command line.

But how should i pass the parameter '-style motif'?
I can run my application by typing "myApp.exe", but when i typed "myApp.exe - style motif", nothing happened, the applicatin did not start.

wysota
16th July 2008, 10:08
myApp.exe -style motif

If the application doesn't start, you need to find out why - the problem is within the application itself (it might rely on some files which it can't find, etc.).

lzha022
16th July 2008, 22:11
myApp.exe -style motif

If the application doesn't start, you need to find out why - the problem is within the application itself (it might rely on some files which it can't find, etc.).

The application starts if i type myApp.exe, but when i type myApp.exe -style motif, it does not.

wysota
16th July 2008, 22:50
Without knowing the code, it is hard to help you. You can try debugging and see if and why the application crashes.

lzha022
17th July 2008, 00:06
Without knowing the code, it is hard to help you. You can try debugging and see if and why the application crashes.

Thanks.
back to the original question, do you know how to fix those linking errors?

wysota
17th July 2008, 07:15
Not without seeing any code and project file.