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

Author Topic: Build works but .exe get launch error  (Read 1967 times)

0 Members and 1 Guest are viewing this topic.

Inspirateur

  • Newbie
  • *
  • Posts: 5
    • View Profile
    • Email
Build works but .exe get launch error
« on: November 12, 2016, 01:36:18 pm »
Hello everybody :D !
I'm using code::blocks on windows 10 and I followed step by step the tutorial to make a .exe using sfml.
So i build the project and code::blocks don't error me, the code runs perfectly on code::blocks, but if i try to run the .exe (in the project_name/bin/debug/ folder) I get instantly a 0xc000007b error.
I linked the sfml modules dynamicaly and got all the necessary dlls in the .exe folder...
Could someone help me ?

Thanks in advance, have a great day :D

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11030
    • View Profile
    • development blog
    • Email
AW: Build works but .exe get launch error
« Reply #1 on: November 12, 2016, 02:48:45 pm »
Sounds like you may have copied the wrong DLLs. From where did you copy the libgcc and libstdc++ DLLs from?
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

Hapax

  • Hero Member
  • *****
  • Posts: 3379
  • My number of posts is shown in hexadecimal.
    • View Profile
    • Links
Re: Build works but .exe get launch error
« Reply #2 on: November 13, 2016, 12:26:48 am »
This particular error seems to commonly be the result of a 32-bit/64-bit mismatch. If you google that error code, it brings up lots of articles that mention this.

Make sure you're linking the correct SFML library to match the architecture target of the compiler. That is, if you are compiling for 32-bit, use 32-bit SFML and if you are compiling for 64-bit, use 64-bit SFML.
Note that this is regardless of whether your system is 32-bit or 64-bit.

Common scenario: 64-bit system compiling to a 32-bit target using 64-bit SFML would likely result in this error.
Selba Ward -SFML drawables
Cheese Map -Drawable Layered Tile Map
Kairos -Timing Library
Grambol
 *Hapaxia Links*

Inspirateur

  • Newbie
  • *
  • Posts: 5
    • View Profile
    • Email
Re: AW: Build works but .exe get launch error
« Reply #3 on: November 13, 2016, 01:45:15 pm »
Thank you for answering :D !

Sounds like you may have copied the wrong DLLs. From where did you copy the libgcc and libstdc++ DLLs from?
I found them on internet, I don't know if there's multiple versions of these dlls so...

---------------------------------------------------------------------------------------------------------------------------------------
This particular error seems to commonly be the result of a 32-bit/64-bit mismatch. If you google that error code, it brings up lots of articles that mention this.

Make sure you're linking the correct SFML library to match the architecture target of the compiler. That is, if you are compiling for 32-bit, use 32-bit SFML and if you are compiling for 64-bit, use 64-bit SFML.
Note that this is regardless of whether your system is 32-bit or 64-bit.

Common scenario: 64-bit system compiling to a 32-bit target using 64-bit SFML would likely result in this error.
When I use >gcc --version, in C:\Program Files (x86)\CodeBlocks\MinGW\bin
I get (among others) this:
- Target: mingw32
- gcc version 4.9.2 (tdm-1)
I have SFML 2.4.0 and I think it's the 32 bit version because there's the openal32.dll in the bin folder...

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11030
    • View Profile
    • development blog
    • Email
Re: AW: Build works but .exe get launch error
« Reply #4 on: November 13, 2016, 02:45:04 pm »
I found them on internet, I don't know if there's multiple versions of these dlls so...
That's what I kind of expected. ;)
Firstly you should never download DLLs from random sites, they too can contain malicious code!
Secondly you can't just use random DLLs with similar names, but you need the ones that come with your compiler. And they are located in C:\Program Files (x86)\CodeBlocks\MinGW\bin.
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

Inspirateur

  • Newbie
  • *
  • Posts: 5
    • View Profile
    • Email
Re: AW: Build works but .exe get launch error
« Reply #5 on: November 13, 2016, 04:14:24 pm »
I found them on internet, I don't know if there's multiple versions of these dlls so...
That's what I kind of expected. ;)
Firstly you should never download DLLs from random sites, they too can contain malicious code!
Secondly you can't just use random DLLs with similar names, but you need the ones that come with your compiler. And they are located in C:\Program Files (x86)\CodeBlocks\MinGW\bin.
IT WORKS !
Thank you so much :'D

Have a nice day

 

anything