Reputation: 11
I getting this strange...strangeness when I try to debug this code segment.
#include <iostream>
#include <conio.h>
#include "windows.h"
#include <SFML/Window.hpp>
#include <SFML/Graphics.hpp>
double frameCount;
int main()
{
frameCount = 18;
std::cout << frameCount << std::endl;
return 0;
}
It compiles for no problem. It even runs properly but if I debug it line-by-line the program seizes up when I try to output "frameCount" to the console;
std::cout << frameCount << std::endl;
The issue is resolved by changing "frameCount" to an int. Here is the debugger result from the line.
[debug]> next
[debug]0x004496f4 in std::ostream::operator<<(double) ()
[debug]>>>>>>cb_gdb:
In std::ostream::operator<<(double) () ()
[debug]> info locals
[debug]No symbol table info available.
[debug]>>>>>>cb_gdb:
[debug]> info args
[debug]No symbol table info available.
[debug]>>>>>>cb_gdb:
[debug]> whatis frameCount
[debug]type = double
[debug]>>>>>>cb_gdb:
[debug]> output frameCount
[debug]1.8>>>>>>cb_gdb:
[debug]> bt 30
[debug]#0 0x004496f4 in std::ostream::operator<<(double) ()
[debug]#1 0x004165ae in __do_global_ctors ()
[debug]#2 0x004010fd in __mingw_CRTStartup ()
[debug]#3 0x00000001 in ?? ()
[debug]#4 0x7ffde000 in ?? ()
[debug]#5 0x7757ad1f in ?? ()
[debug]#6 0x7757acea in ?? ()
[debug]#7 0x00000000 in ?? ()
[debug]>>>>>>cb_gdb:
Upvotes: 0
Views: 56
Reputation: 3047
For your purpose, you don't need
#include <conio.h>
#include "windows.h"
#include <SFML/Window.hpp>
#include <SFML/Graphics.hpp>
above headers. without these headers. It seems okay.
Upvotes: 1