-1

I am trying to make an application with OpenGL and GStreamer. I have a couple of files linking to GStreamer-libraries, but for now, they are not included to the main source file in any way. The program compiles just fine, but upon running, I get the error message

The application was unable to start correctly (0xc000007b).

I got no more information about the error.

But when excluding the GStreamer-related files from the project, while leaving the include- and library-directories in the property page untouched, the code compiles and runs without problems.

I am building for the Win32 platform and have checked that I link to the correct versions of the GStreamer libraries.

Furhermore, when trying to run a build for x64 (also linking properly, I believe), I get the exact same error, even when the files are excluded from the project.

Could anyone tell what's wrong from this sparse information, or at the very least explain why the application won't run when I add files that are not used?

I may give more information on demand, but right now, I really don't know what is relevant.

TheVaffel
  • 51
  • 7
  • 1
    Time to fire up the debugger and see what causes the crash. – Jesper Juhl Jul 06 '16 at 11:27
  • 2
    More than likely you are loading a 64-bit DLL(s) from a 32-bit application. This has nothing to do with the build process -- you can specify all the right libraries at build time, it doesn't matter. It's the Windows OS that is responsible for searching and finding the DLL(s), and Windows doesn't care if the DLL's are the wrong bitness, as long as the names it's looking for match up. [See this](https://msdn.microsoft.com/en-us/library/windows/desktop/ms682586%28v=vs.85%29.aspx) – PaulMcKenzie Jul 06 '16 at 11:30
  • @Jesper It seems like the most reasonable, but the application isn't even started before the error appears. I tried running with a return statement as the first line in the main() function, without luck – TheVaffel Jul 06 '16 at 11:32
  • @TheVaffel That's how Windows works wrt DLL's. The DLL's are loaded implicitly, and your application doesn't get to stop this from happening. – PaulMcKenzie Jul 06 '16 at 11:34
  • @PaulMcKenzie Sounds reasonable, I just found a long-forgotten directory in my PATH-variable which contained some dll-files that likely causes the error. I will try to fix it, thanks for the suggestion! – TheVaffel Jul 06 '16 at 11:38

1 Answers1

1

As suggested by PaulMcKenzie, it turned out that Windows searched through the directories in PATH and took the first dll's that fit, even though they were built for a 64-bit platform.

The cause of the error when I run with x64 turns out to have been that some other dll's, that I had downloaded from a public GitHub repository, were built for 32-bit software.

TheVaffel
  • 51
  • 7