OpenGP/starlab

Having issue in compiling, error occurs on '[&]' expression and the issue logs as expected expression

Closed this issue · 4 comments

I having compile issue which the compiler throws me an error as 'expected expression' on '[&]'. I have never seen this expression before, hope anyone can help this out.

/Users/tanyongsheng/Desktop/starlab-master/core/plugins/gui_render/gui_render.cpp:83: error: expected expression

    connect(toggleBackgroundEffect, &QAction::triggered, [&](){ drawArea()->toggleBackgroundEffect(); drawArea()->updateGL(); });
                                                         ^

i'm using mac with Qt 5.5.0 installed and the compiler is clang:
Apple LLVM version 6.1.0 (clang-602.0.53) (based on LLVM 3.6.0svn)
Target: x86_64-apple-darwin14.5.0

May i know which compiler that i should be using? i have absolutely no problem with Qmake but building this application is a pain for me, i having many compile issues like 'nullptr' is not declared. So i suspect i having different compiler as you do.

Are you enabling c++11 support? (this might help http://stackoverflow.com/a/13352044/463409)

We are using lambda functions often, take a look at this (https://wiki.qt.io/New_Signal_Slot_Syntax).

I hope these help you compile. Please report back if it works. Thanks

Hi ialhashim,

The bad news is,
I still can't compile,i follow the stackoverflow approach, but not aware that if i were done it right. i add compile flag as follow:
screen shot 2015-11-09 at 7 47 13 pm

sorry if i done it wrongly, i know how to code but i'm new to Qt and have little knowledge for configuration like this.

And the good news is,
i can compile with the following approach, after searching on google i found this(http://stackoverflow.com/questions/16948382/how-to-enable-c11-in-qt-creator) absolutely solve the problem.

I have one more question,

How can i migrate this project from Qt creator to Code::Block. I know that Qt creator is good but for some reason i need to migrate it to Code::Block.

I know this is not relevant issue for this project, but i'm trying so hard to make it work on code::block. I hope you can give me some guide.

As far as I know, the Qt build system (qmake) generates Makefiles for the projects. If Code::Block can open these files it should simplify the process. Otherwise, I'd recommend compiling starlab using Qt Creator, then for your own plugin you can setup Code::Block by setting up the include folders and the different libraries needed.