SFML community forums

Help => System => Topic started by: na.mkv on January 16, 2024, 01:57:08 pm

Title: Process finished with exit code -1073741515 (0xC0000135)
Post by: na.mkv on January 16, 2024, 01:57:08 pm
Good day. I have a problem with SFML on Windows 11.

I have the same issue when using SFML for 32 and 64 bit systems.

Here I am attaching the screenshots with the code for cmake and main.cpp.

I really have no idea what is wrong here. It worked fine on Unix, but I have a struggle with win now. I seek help.

Whenever I try to run the program, I get the error message: "Process finished with exit code -1073741515 (0xC0000135)".

I have downloaded the SFML and mingw, and copied them to "C:/" directory
Title: Re: Process finished with exit code -1073741515 (0xC0000135)
Post by: na.mkv on January 17, 2024, 07:11:44 am
Also I have the same issue when I try to compile a file with this code snippet.


void Actions::load_main_menu_music(Music * music) {
    if (!music->openFromFile("../Audio/Music/MainTheme.mp3")) {
        throw std::runtime_error("Couldn't open the music file.");
    }
}

Do somebody have any ideas how to fix this?
Title: Re: Process finished with exit code -1073741515 (0xC0000135)
Post by: Hapax on January 17, 2024, 12:39:51 pm
The same issue?
The same error code when the music doesn't load?

Confirm the music file is valid and in the correct location. An absolute path test can help with this.
Title: Re: Process finished with exit code -1073741515 (0xC0000135)
Post by: na.mkv on January 17, 2024, 01:22:08 pm
The function is not called anywhere. It breaks even before the execution line reaches int main().
It breaks somewhere between the compilation and run.
Title: Re: Process finished with exit code -1073741515 (0xC0000135)
Post by: eXpl0it3r on January 17, 2024, 01:45:07 pm
IIRC 0xC0000135 just means that you're missing some DLL.
If you double click the executable in explorer, it should tell you which DLL exactly is missing.

Most likely, you'll have to copy the SFML DLLs next to your executable.
Title: Re: Process finished with exit code -1073741515 (0xC0000135)
Post by: na.mkv on January 17, 2024, 02:20:18 pm
Assume I copy all DLLs to the project directory. What else? How should I re-write cmake? How to make the snippet

void Actions::load_main_menu_music(Music * music) {
    if (!music->openFromFile("../Audio/Music/MainTheme.mp3")) {
        throw std::runtime_error("Couldn't open the music file.");
    }
}

not to cause the issue? Again, the error appears before even the program runs.
Title: Re: Process finished with exit code -1073741515 (0xC0000135)
Post by: eXpl0it3r on January 17, 2024, 02:29:12 pm
The SFML CMake Template (https://github.com/SFML/cmake-sfml-project/blob/master/CMakeLists.txt) has some code snippet to copy the OpenAL DLL, which I assume might be missing in your case.
Title: Re: Process finished with exit code -1073741515 (0xC0000135)
Post by: na.mkv on January 17, 2024, 02:42:36 pm
Copied and pasted the cmake. Have the problem:

"C:\Program Files\JetBrains\CLion 2023.3.2\bin\cmake\win\x64\bin\cmake.exe" -DCMAKE_BUILD_TYPE=Debug "-DCMAKE_MAKE_PROGRAM=C:/Program Files/JetBrains/CLion 2023.3.2/bin/ninja/win/x64/ninja.exe" -G Ninja -S C:\Users\rcybe\CLionProjects\AsteroidBelt -B C:\Users\rcybe\CLionProjects\AsteroidBelt\cmake-build-debug
CMake Error at C:/Program Files/JetBrains/CLion 2023.3.2/bin/cmake/win/x64/share/cmake-3.27/Modules/ExternalProject.cmake:2851 (message):
  error: could not find git for clone of sfml-populate
Call Stack (most recent call first):
  C:/Program Files/JetBrains/CLion 2023.3.2/bin/cmake/win/x64/share/cmake-3.27/Modules/ExternalProject.cmake:4345 (_ep_add_download_command)
  CMakeLists.txt:29 (ExternalProject_Add)
Title: Re: Process finished with exit code -1073741515 (0xC0000135)
Post by: na.mkv on January 17, 2024, 02:59:01 pm
IIRC 0xC0000135 just means that you're missing some DLL.
If you double click the executable in explorer, it should tell you which DLL exactly is missing.

Most likely, you'll have to copy the SFML DLLs next to your executable.

I ran the executable, it says: "The code execution cannot proceed because libstdc++-6.dll was not found. Reinstalling the program may fix this problem."

The missing files:
libstdc++-6.dll
openal32.dll
libgcc_s_dw2-1.dll
Title: Re: Process finished with exit code -1073741515 (0xC0000135)
Post by: eXpl0it3r on January 17, 2024, 03:01:30 pm
Copied and pasted the cmake.
You can't just copy paste without understanding what it does...  ::)

If you don't want to fetch and build SFML automatically, you don't need everything, check the statements at the bottom.
If you do want to use the full template, read the readme that explain some more things and make sure git is installed.
Title: Re: Process finished with exit code -1073741515 (0xC0000135)
Post by: na.mkv on January 17, 2024, 03:31:18 pm
I have carefully followed the instructions and in the end I got this:


PS C:\Users\rcybe\CLionProjects\AsteroidBelt> cmake --build build --config Release
MSBuild version 17.8.3+195e7f5a3 for .NET Framework
MSBUILD : error MSB1009: Project file does not exist.
Switch: ALL_BUILD.vcxproj
PS C:\Users\rcybe\CLionProjects\AsteroidBelt> cmake -S . -B build                 
-- Selecting Windows SDK version 10.0.22621.0 to target Windows 10.0.22631.
-- Selecting Windows SDK version 10.0.22621.0 to target Windows 10.0.22631.
CMake Error at C:/Program Files/CMake/share/cmake-3.28/Modules/ExternalProject.cmake:2911 (message):
  error: could not find git for clone of sfml-populate
Call Stack (most recent call first):
  C:/Program Files/CMake/share/cmake-3.28/Modules/ExternalProject.cmake:4422 (_ep_add_download_command)
  CMakeLists.txt:29 (ExternalProject_Add)


-- Configuring incomplete, errors occurred!

CMake Error at C:/Program Files/CMake/share/cmake-3.28/Modules/FetchContent.cmake:1667 (message):
  CMake step for sfml failed: 1
Call Stack (most recent call first):
  C:/Program Files/CMake/share/cmake-3.28/Modules/FetchContent.cmake:1819:EVAL:2 (__FetchContent_directPopulate)
  C:/Program Files/CMake/share/cmake-3.28/Modules/FetchContent.cmake:1819 (cmake_language)
  C:/Program Files/CMake/share/cmake-3.28/Modules/FetchContent.cmake:2033 (FetchContent_Populate)
  CMakeLists.txt:11 (FetchContent_MakeAvailable)


-- Configuring incomplete, errors occurred!


To be honest, I am new in Windows; 70% of my time I was working in Linux or MacOS. It is just now I decided completely switch to Windows.
Title: Re: Process finished with exit code -1073741515 (0xC0000135)
Post by: eXpl0it3r on January 17, 2024, 03:36:33 pm
could not find git
As mentioned, you'll need to install git, and then make sure it's in PATH (might require a terminal restart).
Title: Re: Process finished with exit code -1073741515 (0xC0000135)
Post by: na.mkv on January 18, 2024, 11:05:43 am
All began working ok, except, again, for this code snippet:

void Actions::load_main_menu_music(Music * music) {
    if (!music->openFromFile("../Audio/Music/MainTheme.mp3")) {
        throw std::runtime_error("Couldn't open the music file.");
    }
}


I get the error when I execute this command in the terminal: cmake -S . -B build ; cmake --build build --config Release


Error:
Actions.obj : error LNK2019: unresolved external symbol "public: bool __cdecl sf::Music::openFromFile(class std::basic_string<char,struct std::char_traits<char
>,class std::allocator<char> > const &)" (?openFromFile@Music@sf@@QEAA_NAEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z) referenced in func
tion "void __cdecl Actions::load_main_menu_music(class sf::Music *)" (?load_main_menu_music@Actions@@YAXPEAVMusic@sf@@@Z) [C:\Users\rcybe\CLionProjects\Asteroi
dBelt\build\AsteroidBelt.vcxproj]
C:\Users\rcybe\CLionProjects\AsteroidBelt\build\bin\Release\AsteroidBelt.exe : fatal error LNK1120: 1 unresolved externals [C:\Users\rcybe\CLionProjects\Astero
idBelt\build\AsteroidBelt.vcxproj]

Title: Re: Process finished with exit code -1073741515 (0xC0000135)
Post by: hdsiria on January 29, 2024, 03:33:07 am
The sfml environment is definitely not configured correctly. Add the sfml directory and mingw directory to the system path env variable. Set the correct library directory at compile time. There would be no problem.
error LNK2019 mean  the library cannot be found during the link process
Title: Re: Process finished with exit code -1073741515 (0xC0000135)
Post by: eXpl0it3r on January 29, 2024, 08:39:05 am
Add the sfml directory and mingw directory to the system path env variable
...
error LNK2019 mean  the library cannot be found during the link process
LNK errors indicate that MSVC is being used, so MinGW is irrelevant at this point
Title: Re: Process finished with exit code -1073741515 (0xC0000135)
Post by: hdsiria on January 30, 2024, 01:58:53 am
Adding the mingw directory to the path is always correct. He previously mentioned missing libstdc++-6.dll belonging to mingw