Question

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?

Was it helpful?

Solution

>   yaml_test.exe!main()  Line 108  C++
    yaml_test.exe!__tmainCRTStartup()  Line 555 + 0x19 bytes    C
    yaml_test.exe!mainCRTStartup()  Line 371    C
    kernel32.dll!7c817077()     
    [Frames below may be incorrect and/or missing, no symbols loaded for kernel32.dll]

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:

>   yaml_test.exe!operator>>(const YAML::Node & node={...}, Monster & monster={...})  Line 36   C++
    yaml_test.exe!main()  Line 109  C++
    msvcr100.dll!_initterm(void (void)* * pfbegin=0x00000001, void (void)* * pfend=0x003a5050)  Line 873    C
    yaml_test.exe!__tmainCRTStartup()  Line 555 + 0x17 bytes    C
    kernel32.dll!7c817077()     
    [Frames below may be incorrect and/or missing, no symbols loaded for kernel32.dll]

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top