[Qt-interest] Qt code compiles fine on mscv9.0 but failed with gcc

Bruno Colombet Bruno.Colombet at univmed.fr
Tue Jan 25 14:24:59 CET 2011


Hello everybody,

I'm developping a Qt application for several months now and my main IDE 
is Visual Studio 2008 on Windows.
By the way, I must assure my application compiles on Linux and Mac OS X.

I get used to modify part of my code to make sure gcc will compile it 
but I wonder if there is a clean way to solve my problem.
Here is an example :

Class myclass
{
     public:
         void setName(QString& name);
}


myclass mc;

mc.setName(QString("test"); <=== compiles fine with MSCV

got errors with gcc : no matching function for call 
'myclass::setName(QString)' candidates are : void myclass::setName(QString&)

And a more complex problem in an other part of the code I have a methode 
like this :

- void addCustomChannel(Channel *channel, QString& after = QString("LAST"));

a call like this :  addCustomChannel(chan)  compiles in MSCV
but gcc complains: error: default argument parameter of type 'QString&' 
has type 'QString'


Any suggestions?
Thanks


-- 
Bruno Colombet
*INSERM UMR 751* - Epilepsie et Cognition
Faculté de Médecine
27 Bd Jean Moulin
13385 Marseille cedex 05
+33 4 91 38 55 40
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20110125/e0fc98e1/attachment.html 


More information about the Qt-interest-old mailing list