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

Author Topic: Application was unable to start correctly (0xc000007b)  (Read 7515 times)

0 Members and 1 Guest are viewing this topic.

Mattermonkey

  • Newbie
  • *
  • Posts: 7
    • View Profile
Application was unable to start correctly (0xc000007b)
« on: June 29, 2018, 07:07:29 pm »
So I've tried compiling my first sfml application, using minGW. The source can be seen here: https://pastebin.com/bVg0U35K (it's very short, just a hello world kinda thing). So I compile it with this command:
g++ sfmltest.cpp -o sfmltest -L c:/lib/lib -lsfml-graphics -lsfml-window -lsfml-system
and it compiles fine. the .a files and .dlls are in C:/lib/lib, and the headers are in a place where they definitely get included.
Attempting to run the program generates the message "The application was unable to start correctly (0xc000007b)". Some quick googling yields this page https://stackoverflow.com/questions/10492037/the-application-was-unable-to-start-correctly-0xc000007b, telling me this issue is probably due to 32-bit 64-bit mismatches, but I compiled sfml myself using cmake, with the very compiler I'm using for this program, and by the check suggested in the top answer of this post https://superuser.com/questions/358434/how-to-check-if-a-binary-is-32-or-64-bit-on-windows, it seems that my compiler, all of the sfml dlls, and the compiled program that generates the error, are all x86.

The stack overflow thread also says that "dependency walker saved the day", so I tried that.
It reports that all of the libraries in this thread https://stackoverflow.com/questions/17023419/win-7-64-bit-dll-problems are missing, but that thread seems to indicate this isn't actually a problem.
It also, however, reports that libgcc_s_seh-1.dll is missing, and indeed my minGW doesn't contain this file, instead containing libgcc_s_dw2-1.dll.

In summary, the whole process of linking sfml has been long and arduous, and every time I solve an issue another one crops up to replace it. I've tried googling the issues, and requesting help elsewhere (these two reddit threads https://www.reddit.com/r/sfml/comments/8rzlis/undefined_reference_when_trying_to_link_sfml/ https://www.reddit.com/r/Compilers/comments/8n1ssv/help_linking_a_library_sfml/, although these threads are likely not very useful to read through, since they largely concern linking issues that have already been solved). It would be very much appreciated if someone could aid me in finally getting this library up and running.

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 10847
    • View Profile
    • development blog
    • Email
Re: Application was unable to start correctly (0xc000007b)
« Reply #1 on: June 29, 2018, 08:55:27 pm »
What compiler are you using?
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

Mattermonkey

  • Newbie
  • *
  • Posts: 7
    • View Profile
Re: Application was unable to start correctly (0xc000007b)
« Reply #2 on: June 30, 2018, 09:55:06 am »
It's a windows 7, 64 bit laptop. The compiler I'm using is https://mingw-w64.org/doku.php, which despite the name, isn't 64-bit. I think it's just called that because it supports creating 64-bit programs.

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 10847
    • View Profile
    • development blog
    • Email
Re: Application was unable to start correctly (0xc000007b)
« Reply #3 on: June 30, 2018, 10:17:54 am »
So which version did you download exactly and how did you build SFML?
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

Mattermonkey

  • Newbie
  • *
  • Posts: 7
    • View Profile
Re: Application was unable to start correctly (0xc000007b)
« Reply #4 on: June 30, 2018, 11:17:58 am »
"g++ --version" tells me that my compiler is version 7.1.0.

I downloaded sfml from here https://github.com/SFML/SFML/archive/master.zip, used cmake to generate a mingw makefile, and ran mingw32-make, which produced the .a and .dll files I'm now trying to link.

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 10847
    • View Profile
    • development blog
    • Email
Re: Application was unable to start correctly (0xc000007b)
« Reply #5 on: June 30, 2018, 04:50:29 pm »
Is the compiler you used to build your application the same as the one used to build SFML? How would you check that?
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

Mattermonkey

  • Newbie
  • *
  • Posts: 7
    • View Profile
Re: Application was unable to start correctly (0xc000007b)
« Reply #6 on: June 30, 2018, 04:58:35 pm »
That was actually an issue I had earlier in the process. My haskell compiler installation had a g++ in it for some reason, and was earlier in my path variable. This meant sfml was built using that one. When the include files didn't work, I pinpointed that as the problem. After fixing that, there were a bunch of undefined reference errors, which I tracked down to the same issue. After removing the duplicate g++ from my path, and rerunning cmake and mingw32-make, those issues disappeared to be replaced by this one.

So I'm pretty sure that yes, the compilers are the same, and in fact them being the same was the solution to a problem I solved already.

Mattermonkey

  • Newbie
  • *
  • Posts: 7
    • View Profile
Re: Application was unable to start correctly (0xc000007b)
« Reply #7 on: July 02, 2018, 06:40:30 pm »
Ok this is weird, I redownloaded the source, and recompiled with CMake.

Running the "pong" example that was generated produces the same error.

I guess this means that it's not just something stupid I'm doing with my build command.

I just ran mingw32-make on the makefile CMake generated, which built both pong and the libraries through one makefile, so the compilers that compiled tham have to be identical, right?

What on earth could cause this problem?
« Last Edit: July 02, 2018, 07:00:46 pm by Mattermonkey »

Mattermonkey

  • Newbie
  • *
  • Posts: 7
    • View Profile
Re: Application was unable to start correctly (0xc000007b)
« Reply #8 on: July 02, 2018, 06:46:42 pm »
Using dependency walker on pong.exe gives me exactly the same list of missing dlls.
Should libgcc_s_seh-1.dll be present in my minGW, because all I have is libgcc_s_dw2-1.dll?

Mattermonkey

  • Newbie
  • *
  • Posts: 7
    • View Profile
Re: Application was unable to start correctly (0xc000007b)
« Reply #9 on: July 02, 2018, 07:04:27 pm »
I tried rerunning it, with the CMake flag BUILD_SHARED_LIBS set to false to build static sfml libraries, and now the examples don't generate an error message, they simply open and immediately close.

Gerard Wensink

  • Newbie
  • *
  • Posts: 5
    • View Profile
    • Github
    • Email
Re: Application was unable to start correctly (0xc000007b) SOLVED
« Reply #10 on: January 03, 2019, 05:54:22 pm »
When compiling (or using binaries) 64 bit (like mingw seh version) and you get a popup box with a

0xc000007b error

You need these extra files in the dir:

libgcc_s_seh-1.dll
libstdc++-6.dll
libwinpthread-1.dll

They are in the gcc lib dir.

Gerard Wensink

  • Newbie
  • *
  • Posts: 5
    • View Profile
    • Github
    • Email
Re: Application was unable to start correctly (0xc000007b)
« Reply #11 on: January 04, 2019, 01:00:34 am »
I tried rerunning it, with the CMake flag BUILD_SHARED_LIBS set to false to build static sfml libraries, and now the examples don't generate an error message, they simply open and immediately close.

I got exactly the same when compiling with x86_64-7.3.0-release-posix-seh-rt_v5-rev0 as told on the download page. The binary download works when adding the 3 dll's i mentioned in another post reply.
Using cmake 3.10.2

Its the same thing over and over again.
Q) How did the sfml team compiled the source code 2.5.1?

If we can not compile it with the same compiler as they mentioned, how can they do it?
100% of all guidelines on the net DON'T WORK. They never do. NEVER.

Looks like people manipulate the open source so normal dudes like me can not use the shit like they tell.
What is the

PHONE NUMBER

of the person who compiled the binaries?

HOW DID HE/SHE DO IT?
And is he/she part of the Bill Gates Illuminati?

So, somebody else had same problem. The programs pop up and quit.

So i figured out the directory resources from the example program, has to be copied also into the out dir of the compilation in the output of the example dir.
Like out/examples/pong/resources.

THE PROGRAM DON'T TELL IT CAN NOT FIND THE SOUND FILE!!!!! Now, that is stupid.

What is most stupid,

NOBODY (since aug. 2018) HAS GIVEN THIS ANSWER!!!!! WHILE ITS SO SIMPLE!!!!

Btw, check out my code with static ffmpeg 2.8 libs:
https://drive.google.com/file/d/1h6oPoJL7dlAHwQarpFEGmoyWj6o31Kea/view?usp=sharing
Or (with also static ffmpeg 2.8 libs)
https://github.com/crazybytes/PACMAN-GRAPHICS
Or https://github.com/crazybytes/PACMAN (readme file contains some info, not all, check the code for hidden features for now)
« Last Edit: January 04, 2019, 10:24:51 pm by eXpl0it3r »