• Advertisement
Sign in to follow this  

Crash depending on file name

This topic is 1808 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

So this has had me stumped for several hours today, and I finally was able to track down what was causing my crash, but I'm not sure why.  A little background:

 

My project is using GLFW to handle creating the OpenGL context.  Everything was working fine until I tried to add some files from an open source project to do some file parsing.  The library contained some *.cc files.  After adding these files, my program would always crash when trying to create the window, down in dbgheap.c (_CrtIsValidHeapPointer).  

 

The first weird thing I noticed was that this crash would happen even if I wasn't calling into any of the new library.  So I started removing more and more of the library until I was left with a single *empty* .cc file.  Removing the *.cc file fixed the problem.  If I re-added the .cc file, the crash would immediately start happening again.  

 

So I started experimenting some more.  Renaming the file to a .h file *inside VS* wouldn't fix the crash, but if I removed the file from VS, renamed it from the file explorer, and then re-added it as a .h, it wouldn't crash.  Oddly, once I had added it as a .h, I could rename it back to .cc inside VS and it would be fine.

 

Also, I noticed that the crash only happens during a Debug build.  Release is fine.

 

So, I'm not entirely sure what's going on here, but it might have something to do with the .cc file causing VS to use some different versions of the standard libraries, which are somehow causing a crash?  I thought .cc was just another extension for C++ files.  Can somebody explain what exactly is going on here?  

Share this post


Link to post
Share on other sites
Advertisement

Maybe it's got to do with the fact that cpp files are required to end with a newline. Seems kinda strange though, especially on a modern compiler.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement