c++ - Facing "unable to find string literal operator" error when compiling ui code with C++11 -
i compiling qtgui application (version 4) own gnu makefile. worked nice when used c++03 standard gcc compiler.
now need c++11 standard , error:
unable find string literal operator 'operator"" __ file__' "
at following lines in window.cpp
connect(ui->myglwidget, signal(xrotationchanged(int)), ui->rotxslider, slot(setvalue(int))); connect(ui->myglwidget, signal(yrotationchanged(int)), ui->rotyslider, slot(setvalue(int))); connect(ui->myglwidget, signal(zrotationchanged(int)), ui->rotzslider, slot(setvalue(int))); i tried compile .ui file uic version 4 , 5 , nothing changed. result of uic, ui_window.h has same errors whenever qbject::connect(.....) used.
i can't go old c++ standard , both uic compilers produces same ui_window.h file.
how can rid of it?
before c++11, syntax "foo"__file__ compile "foo""filename.cpp", resulting in concatenated string "foofilename.cpp". c++11 added new feature, user-defined string literals, uses suffixes @ end of string literal "foo"_bar perform conversion of string "foo" other type. consequence, "foo"__file__ compiles attempt invoke user-defined string literal operator __file__ on "foo".
presumably signal , slot both macros on source lines indicated - know little qt - , 1 or both of expansions result in "foo"__file__ being present after preprocessing, resulting in error observe. if upgrading more recent qt not option you, trace definition of macros , ensure there space between tokens resulting in "foo"__file__. inserting space may sufficient, if macro definitions involve heavy token-pasting forcing token break comment /**/ needed.
Comments
Post a Comment