Welcome, Guest. Please login or register. Did you miss your activation email?

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - GMahir

Pages: [1]
1
General / I can't use std::ofstream
« on: November 05, 2015, 12:09:08 am »
I'm trying to make an animation of moving arrows and I need to keep record of time, in a text file, how much arrows stays visible on the screen. But when I write(and not even use that variable):
std::ofstream record;
It compiles without an error but screen shows up and closes immediately. It shows one frame but never gets into main loop. But when I delete only that line everything else works fine.
I suspected namespace members overlapping somehow but that's not the issue.I tried on Windows 7 x64 with CodeBlocks+mingw(GCC 4.8.1) and on Ubuntu 15.04 x64 with gcc 5.1.0.
I tried with a simple program (one that is here bottom of the page : http://www.sfml-dev.org/tutorials/2.3/start-cb.php) and added that the lines that I'm trying to use to write to a text file,only with a random string, and it works.
There are a little too much code so I didn't paste it all here and couldn't simplify it but I'm adding the files as an attachment.
This is how I compile if it's relevant:
g++ -std=c++11 -Wall -Wextra -Werror main.cpp -lm arrow.hpp -lsfml-graphics -lsfml-window -lsfml-system

I really need to keep the records and if there is another way of doing it, I'd like to know.

Pages: [1]