SFML community forums

Help => General => Topic started by: DevGoose on April 02, 2022, 10:11:16 am

Title: Error when building my project in visual studio
Post by: DevGoose on April 02, 2022, 10:11:16 am
Hello,

I am getting the following error when i try to build my project: The application was unable to start correctly (0xc000007b). Click OK to close the application. I am 99.9% certain the code works fine the only thing is that i made an src folder to put the code int it where the file .vcxproj is in. I am pretty sure where the code is, is causing the problem because i have made two projects before and none of them did this and the code in those projects was not separeted from vcxproj or others here's the output message.

'Asteroids.exe' (Win32): Loaded 'C:\Dev\PROJECTS\c++\Asteroids\Windows\Asteroids\x64\Debug\Asteroids.exe'. Symbols loaded.
'Asteroids.exe' (Win32): Loaded 'C:\Windows\System32\ntdll.dll'.
'Asteroids.exe' (Win32): Loaded 'C:\Windows\System32\kernel32.dll'.
'Asteroids.exe' (Win32): Loaded 'C:\Windows\System32\KernelBase.dll'.
'Asteroids.exe' (Win32): Loaded 'C:\Dev\PROJECTS\c++\Asteroids\Windows\Asteroids\x64\Debug\sfml-window-d-2.dll'.
'Asteroids.exe' (Win32): Unloaded 'C:\Dev\PROJECTS\c++\Asteroids\Windows\Asteroids\x64\Debug\sfml-window-d-2.dll'

One thing that i found weird was that when window-d-2.dll gets loaded it immadiatly gets unloaded.

SFML is version 2.5.1, on Windows.

Thank-You in advance.
Title: Re: Error when building my project in visual studio
Post by: kojack on April 02, 2022, 10:53:33 am
This can be caused by mixing 32 bit and 64 bit libraries (which isn't allowed).
Based on the directory it appears to be building to, it looks like your project is 64 bit (ignore the Win32 bit on each line, my 64bit apps say that too). But did you get the 64 bit version of sfml too?
Or if your project is 32 bit, is sfml also 32 bit?
Title: Re: Error when building my project in visual studio
Post by: DevGoose on April 02, 2022, 11:03:54 am
My project is 64 bit and sfml is 32.

So i am supposed to delete sfml and download the 64 bit one onto my computer right?
Title: Re: Error when building my project in visual studio
Post by: DevGoose on April 02, 2022, 11:52:49 am
It worked thank you :)
Title: Re: Error when building my project in visual studio
Post by: kojack on April 02, 2022, 12:13:06 pm
While windows itself can run either (Windows 64 bit can run 32 bit apps), within a single program the libraries and executable must all be the same platform. 64 with 64 or 32 with 32.

Glad it worked. :)
Title: Re: Error when building my project in visual studio
Post by: DevGoose on April 02, 2022, 10:59:39 pm
Do you have any idea why in my other projects the code worked when it was in it's normal place even though sfml was 32 bit and my projects were 64.
Title: Re: Error when building my project in visual studio
Post by: eXpl0it3r on April 16, 2022, 02:40:17 pm
They might have not been 64-bits. Until VS 2022 (or 2019?), the default was 32-bits