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

Author Topic: sfml-window interfering with fopen  (Read 1872 times)

0 Members and 1 Guest are viewing this topic.

joelwilliamson

  • Newbie
  • *
  • Posts: 2
    • View Profile
    • Email
sfml-window interfering with fopen
« on: August 01, 2012, 04:53:18 am »
I'm using SFML 1.6 on Fedora 17.

#include <stdio.h>
#include <errno.h>
#include <error.h>

int main(int argc, char* argv[])
{
   
    FILE *fp = fopen("./simple_vertex.glsl","r");
    if (errno)
    {
        error(1,errno,"File failed to open");
    }
   
    return 0;
}

compiles and runs fine when compiled with g++ -lsfml-system fopen_error_test.cpp -o fopen_error_test && ./fopen_error_test. If I compile with g++ -lsfml-system -lsfml-window fopen_error_test.cpp -o fopen_error_test && ./fopen_error_test, I get "./fopen_error_test: File failed to open: Resource temporarily unavailable".

Any idea what could be causing this?

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: sfml-window interfering with fopen
« Reply #1 on: August 01, 2012, 08:01:19 am »
Weird. Does it happen only with fopen?

Anyway, make sure that your graphics drivers work fine with OpenGL (try to execute "glxgears").
Laurent Gomila - SFML developer

joelwilliamson

  • Newbie
  • *
  • Posts: 2
    • View Profile
    • Email
Re: sfml-window interfering with fopen
« Reply #2 on: August 01, 2012, 07:36:26 pm »
Its also happening with chmod() and open() in both read-only and write-only modes. My OpenGL drivers are working fine: glxgears runs at 60 FPS. Does SFML run fine with Mesa drivers?

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: sfml-window interfering with fopen
« Reply #3 on: August 02, 2012, 08:02:37 am »
SFML works fine with any OpenGL implementation.

It's really weird, but I don't think it has anything to do with SFML itself. Maybe something weird in your environment.
Laurent Gomila - SFML developer

 

anything