Will_Panda
Will_Panda

Reputation: 534

Qt project C2872 error, ambiguous symbol in generated ui files

I am trying to build a Qt project which builds without a hiccup in two other machines. But when I try to build it I get many errors similar to the following from the automatically generated ui files.

C2872 "lambda0" : ambiguous symbol ui_GeneratedUi.h 91

I am using VS platform toolset 100 and Qt 5.5 which is the same configuration in other machines. The error appears mostly when the setObjectName() method in QObject is called.

I read the MSDN page on the error and I cannot find any duplicate types in namespaces.

Upvotes: 0

Views: 649

Answers (1)

Will_Panda
Will_Panda

Reputation: 534

Finally I found a solution for this. Apparently the culprit is the stdafx.h precompiled header file. I tried all the other workarounds but didn't work.

I removed the stdafx.h and stdafx.cpp from the project and then removed it from the pre-compiled headers in the project settings. Then I resolved all the include errors that occurred manually.

I still don't know why stadfx did this but the solution for the problem for me was this.

Upvotes: 1

Related Questions