引用Windows Kits ucrt assert.h标头引发错误 [英] Reference to Windows Kits ucrt assert.h header throws error

查看:189
本文介绍了引用Windows Kits ucrt assert.h标头引发错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

操作系统:Windows 10

OS: Windows 10

IDE:Visual Studio 2017社区

IDE: Visual Studio 2017 Community

Lang:C ++

Lang: C++

涉及的库:机器人库,Qt,Windows工具包10

Libraries involved: Robotics Library, Qt, Windows Kits 10

我猜测错误的根源不是编译器所说的,但是它没有给出比这条消息更好的线索:

Hi, I'm guessing the root of the error is not where the compiler says it is, but it doesn't give any better clues than this message:

>------ Build started: Project: RRTFinal, Configuration: Release Win32 ------
1>RRTFinal.cpp
1>Unknown compiler version - please run the configure tests and report the results
1>g:\windows kits\10\include\10.0.17763.0\ucrt\assert.h(15): error C2144: syntax error: 'int' should be preceded by ';'
1>g:\windows kits\10\include\10.0.17763.0\ucrt\assert.h(15): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>Done building project "RRTFinal.vcxproj" -- FAILED.

我在其他Q& A论坛中寻找类似的问题,并认为这可能是因为链接序列中较早出现的错误。我不熟悉C ++,所以就我而言,它可能是任何东西。

I've looked for similar problems in other Q&A forums and think it's probably because of an error that appears earlier in the linking sequence. I'm not that experienced with C++ though, so it could be anything as far as I'm concerned.

似乎引用ucrt / assert的文件。 h(来自试验和错误)是

The file(s) that seem(s) to reference ucrt/assert.h (from trial and error) are

mdl / {kinematic.h,model.h,xmlfactory.h}(以下是他们在我的项目层次结构中的位置。我复制了所有(? )相关的.h {pp}和.lib文件进入项目,因为我花了一些时间来弄清楚如何修改Visual Studio项目额外的
包含路径)

mdl/{kinematic.h, model.h, xmlfactory.h} (Below is where they are in my project hierarchy. I copied all(?) of the pertinent .h{pp} and .lib files into the project because it took me a while to figure out how to modify the Visual Studio project additional includes path)

#include "include/rl/mdl/kinematic.h" //can't include these mdl ones...
#include "include/rl/mdl/model.h"
#include "include/rl/mdl/xmlfactory.h"

(https://www.roboticslibrary.org/download) 。 Qt是一个依赖项,显然Windows Kits(10)也是如此。我在过去几天内下载了所有这些内容,因此它们应该是最新的。

from the Robotics Library (https://www.roboticslibrary.org/download). Qt is a dependency, and apparently Windows Kits (10) is too. I downloaded all of these within the past few days so they should be up to date.

这可能是机器人库的一个问题,与我试图获得的所有内容有关包含和库引用工作,但编译器错误消息根本没用,我不知道该问谁。

It's probably an issue with the Robotics Library, having to do with what I've tried to get all the include and library references to work, but the compiler error message is not helpful at all and I'm not sure who to ask.

感谢您的帮助。

推荐答案

"未知编译器版本"警告应该会引起一些警报。 您的Robotics库是否承诺支持Visual Studio 2017?

The "unknown compiler version" warning should cause you some alarm.  Does your Robotics library promise support for Visual Studio 2017?

您在那里遇到的错误通常意味着在包含之前会有一些奇怪的现象。 例如,考虑"xxx.h"和"xxx.h"。包含完全正常的"int x = 0;" 现在考虑源文件

The kind of error you have there usually means there was some strangeness immediately before the include.  Consider, for example if "xxx.h" contains the perfectly normal "int x = 0;"  Now consider the source file

    char x

    #include" xxx.h"

    char x
    #include "xxx.h"

请注意缺少的分号。 这将导致您看到的错误,并且它将被诊断为xxx.h中的问题。

Note the missing semicolon.  That would cause the error you see, and it would be diagnosed as a problem in xxx.h.


这篇关于引用Windows Kits ucrt assert.h标头引发错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆