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

Author Topic: Error when building my project in visual studio  (Read 2380 times)

0 Members and 1 Guest are viewing this topic.

DevGoose

  • Newbie
  • *
  • Posts: 4
    • View Profile
    • Email
Error when building my project in visual studio
« 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.
« Last Edit: April 02, 2022, 10:19:25 am by DevGoose »

kojack

  • Sr. Member
  • ****
  • Posts: 343
  • C++/C# game dev teacher.
    • View Profile
Re: Error when building my project in visual studio
« Reply #1 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?

DevGoose

  • Newbie
  • *
  • Posts: 4
    • View Profile
    • Email
Re: Error when building my project in visual studio
« Reply #2 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?
« Last Edit: April 02, 2022, 11:05:55 am by DevGoose »

DevGoose

  • Newbie
  • *
  • Posts: 4
    • View Profile
    • Email
Re: Error when building my project in visual studio
« Reply #3 on: April 02, 2022, 11:52:49 am »
It worked thank you :)

kojack

  • Sr. Member
  • ****
  • Posts: 343
  • C++/C# game dev teacher.
    • View Profile
Re: Error when building my project in visual studio
« Reply #4 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. :)

DevGoose

  • Newbie
  • *
  • Posts: 4
    • View Profile
    • Email
Re: Error when building my project in visual studio
« Reply #5 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.
« Last Edit: April 02, 2022, 11:03:31 pm by DevGoose »

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11032
    • View Profile
    • development blog
    • Email
Re: Error when building my project in visual studio
« Reply #6 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
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

 

anything