title: Error with `fopen` and QT(MinGW)
body: <p>I have the following code in my QT application:</p>
  
  <p><code>FILE * file = fopen(m_fileName.c_str(), "rb");</code></p>
  
  <p>, where the type of <code>m_fileName</code> is <code>std::string</code>.
  This code works fine in Visual Studio2012. But in QT 4.7.4 (MinGW compiler) my program crashes at this line.</p>
  
  <p>I don't really know what is wrong with this code. I haven't used MinGW a lot, so there must be something I don't know about.</p>
  
  <p><strong>Update:</strong></p>
  
  <p>Code from <code>main.cpp</code>:</p>
  
  <pre><code>std::string fileName = "test1.bmp";
  m_pTexture1 = new Texture(GL_TEXTURE_2D, fileName);
  if (!m_pTexture1-&gt;Load()) {
     return;
  }
  </code></pre>
  
  <p>Simplified code of <code>Texture.cpp</code>:</p>
  
  <pre><code>Texture::Texture(GLenum TextureTarget, std::string FileName)
  {
      m_textureTarget = TextureTarget;
      m_fileName = FileName;
  }
  
  bool Texture::Load()
  {
      try {
          FILE * file = fopen(m_fileName.c_str(),"rb");
      }
      catch (...) {
          std::cout « "Error loading texture '" « m_fileName;
          return false;
      }
  }
  </code></pre>
  
  <p>Code of <code>Texture.h</code>:</p>
  
  <pre><code>class Texture
  {
  public:
      Texture(GLenum TextureTarget, std::string FileName);
      bool Load();
  
  private:
      std::string m_fileName;
      GLenum m_textureTarget;
      GLuint m_textureObj;
      unsigned int width, height;
      unsigned char * data;
  };
  </code></pre>
  
  <p>Yes, @PaulMcKenzie was right. I tried to print <code>m_fileName</code> in constructor and it crushed the program. Looks like <code>m_fileName</code> can't be initialized. But, I don't know why this happens.</p>
  
  <p><strong>Update 2</strong></p>
  
  <p>I figured out it crushes because of <code>printf</code> and other C i/o functions. Very strange.</p>