LEFEVRE Damien .net

Tuesday 7 February 2012, 12:17

Qt + Visual Studio 2010: "CXX0030: Error: expression cannot be evaluated."

I got that error when working on a simple Qt app and found it impossible to do debugging since I could not visualize any of the objects.

It turned out that the C++ Optimization was set to /O2. So if you change that back to Disabled, debugging will be all good again.

  • Right click on your project, Properties
  • Expand Configuration Properties, C/C++, Optimization
  • For Optimization set "Disabled (/Od)"
  • Apply
  • Clean
  • Rebuild

I should do some research to confirm but it appear not to be a problem related to Qt at all but more of a C++ compiler option mismatch.

Tuesday 7 February 2012, 09:26

Qt setup + IntelliSense

To get IntelliSense and Qt debugging working properly on my development machine (x64) and VisualStudio 2010 I did the followinf steps.

;Qt Integration
QObject =classname=<staticMetaObject.d.stringdata,s> superclassname=<staticMetaObject.d.superdata->d.stringdata,s>
QString=<d->data,su> size=<d->size,u>
QByteArray=<d->data,s> size=<d->size,u>
QUrl =<d->encodedOriginal.d->data,s>
QUrlInfo =<d->name.d->data,su>
QPoint =x=<xp> y=<yp>
QPointF =x=<xp> y=<yp>
QRect =x1=<x1> y1=<y1> x2=<x2> y2=<y2>
QRectF =x=<xp> y=<yp> w=<w> h=<h>
QSize =width=<wd> height=<ht>
QSizeF =width=<wd> height=<ht>
QMap<*> =size=<d->size>
QVector<*> =size=<d->size>
QHash<*> =size=<d->size>
QVarLengthArray<*> =size=<s> data=<ptr>
QFont =family=<d->request.family.d->data,su> size=<d->request.pointSize, f>
QDomNode =name=<impl->name.d->data,su> value=<impl->value.d->data,su>
  • Then to stop IntelliSense winning you must add the following include directories to every project configurations: