简体   繁体   English

包含 boost C++ 头文件时出现 Qt Creator 错误

[英]Qt Creator error when include boost C++ header

I am new to Qt.我是 Qt 的新手。 I have a simple Widget application, and I try to link to boost C++, My boost lib was built with MSVC all libboost files has "msvc-140/141" names I add the include path and lib path as shown in the graph below我有一个简单的 Widget 应用程序,我尝试链接到 boost C++,我的 boost lib 是用 MSVC 构建的,所有 libboost 文件都有“msvc-140/141”名称我添加了包含路径和 lib 路径,如下图所示我的简历then I go to my header file of the mainwindow and include the boost thread and signals headers, then the Qt creator pop up an warning: "The code model could not parse an included file, which might...." But strange thing happens from here after I added the include files and turn back to source file I found然后我转到主窗口的头文件并包含 boost 线程和信号头,然后 Qt 创建者弹出一个警告:“代码模型无法解析包含的文件,这可能......”但奇怪的事情发生了从这里添加包含文件并返回到我找到的源文件后主窗口.cppI have never encountered this issue and I couldn't find solutions online.我从来没有遇到过这个问题,我无法在网上找到解决方案。 Is this due to the dynamic linking problem with boost C++?这是由于boost C++的动态链接问题吗? (I need boost because some of external dlls use boost signals/slots mechanism and I encountered the same issue when trying link with them. So I decided to make things simple to check if the link with boost fails in Qt) Does anyone encounter this problem? (我需要 boost 因为一些外部 dll 使用 boost 信号/插槽机制,我在尝试与它们链接时遇到了同样的问题。所以我决定让事情变得简单以检查 Qt 中与 boost 的链接是否失败)有没有人遇到过这个问题?

I solved the problem by switching off the CLang code model and amend the C++11 -> C++ 14 in my project file我通过关闭 CLang 代码模型并修改我的项目文件中的 C++11 -> C++ 14 解决了这个问题

Charles Dec 20 '18 at 10:18查尔斯 18 年 12 月 20 日 10:18

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM