YAML 与 VC++ 2010将编译为Release,但不会编译为Debug
我正在尝试使用 C++ 学习 YAML,我使用 CMake 使用 VC++ Express 2010 将给定的 yaml-cpp 文件转换为 .dll 和 .lib 文件。我设置我的项目的方式与设置其他库(如 SFML)相同。
我的问题是,当我尝试构建 yaml-cpp 站点上给出的示例代码的发布版本时,我得到:
Ogre
Dragon
Wizzard
但是,当我尝试构建调试版本时,我得到:
Assertion failed: false, file d:\microsoft visual studio 10.0\vc\include\yaml-cp
p\nodeimpl.h, line 39
我不知道如何处理这个问题。我需要构建该库的调试版本吗?如果是,怎么办?我不知道如果我设法改变某些东西,哪些项目选项可能会影响这一点。
当我编译时,我收到警告:
d:\microsoft visual studio 10.0\vc\include\yaml-cpp\conversion.h(51): warning C4146: unary minus operator applied to unsigned type, result still unsigned
With alot of template printouts, fe :
1> d:\microsoft visual studio 10.0\vc\include\yaml-cpp\nodereadimpl.h(35) : see reference to function template instantiation 'bool YAML::ConvertScalar<T>(const YAML::Node &,T &)' being compiled
1> with
1> [
1> T=unsigned int
1> ]
Is this a Problem on my side? CMake 文件和编译错误?
I'm trying to learn YAML with C++, i made the given yaml-cpp files into a .dll and .lib file with VC++ Express 2010 by using CMake. I have set up my project the same way i set up other libraries like SFML.
My issue is, when i try to build a Release version of the example code given on the yaml-cpp site i get:
Ogre
Dragon
Wizzard
However, when i try to build a Debug version, i get:
Assertion failed: false, file d:\microsoft visual studio 10.0\vc\include\yaml-cp
p\nodeimpl.h, line 39
I don't know how to handle this. Do i need to build a debug version of the library? If yes, how? I don't know which project options could affect this if i managed to change something.
When i'm compiling, i get a warning:
d:\microsoft visual studio 10.0\vc\include\yaml-cpp\conversion.h(51): warning C4146: unary minus operator applied to unsigned type, result still unsigned
With alot of template printouts, f.e. :
1> d:\microsoft visual studio 10.0\vc\include\yaml-cpp\nodereadimpl.h(35) : see reference to function template instantiation 'bool YAML::ConvertScalar<T>(const YAML::Node &,T &)' being compiled
1> with
1> [
1> T=unsigned int
1> ]
Is this a problem on my side? Bad CMake file and compilation?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
中止于:
doc[i]>>怪物;
程序不会尝试进入重载函数。
在我自己的代码中,当我尝试使用我的第一个 >> 时,它会中断。运算符,它是 int 的内置运算符。
我正在使用 http://pastebin.com/PdKWDgQa 中的代码,尽管对于原始 yaml-cpp 示例代码它做同样的事情。 Release模式下的输出是正确的,Debug停止并返回相同的断言代码。
作为参考,Release 模式下的堆栈调用位于 >> 中的 { 括号处。 Monster 的函数看起来像这样:
编辑:
实际上,我已经重建了我用 CMake 制作的 yaml-cpp 项目作为调试,当我现在使用它时,一切都运行良好。如果这是显而易见的,我很抱歉,我对此类问题很陌生。
Aborts at:
doc[i] >> monster;
The program doesn't try to enter the overloaded function.
In my own code it breaks when i try to use my first >> operator, which is the build in one for int.
I'm using the code from http://pastebin.com/PdKWDgQa, though for the original yaml-cpp example code it does the same. The output in Release mode is right, Debug stops and returns the same assert code.
For reference, the stack call in Release mode at the { bracket in the >> function for monster looks like this:
EDIT:
Actually, i have rebuilt the yaml-cpp project i made with CMake as Debug, everything runs fine when i use it now. I'm sorry if this is obvious, i'm new to these kind of issues.