[Qt-interest] Qt code compiles fine on mscv9.0 but failed with gcc
Paul Miller
paul at fxtech.com
Tue Jan 25 14:59:18 CET 2011
On 1/25/2011 7:24 AM, Bruno Colombet wrote:
> 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
Not for me. I'm running VS2008 (RTM, not SP1), and after I rename Class
to class and add the missing semi to the end of your myclass
declaration, and put the mc and setName bits into an actual function, I
get these errors:
error C2958: the left parenthesis '(' found at 'xxx' was not matched
correctly
error C2143: syntax error : missing ')' before ';'
error C2143: syntax error : missing ';' before '<='
Pretty specific.
More information about the Qt-interest-old
mailing list