Raylib does not Initialize

In the first part of the axe game section, I’ve run into a problem when trying to create the popup window.
When I ask VSCode to start debugging, everything proceeds properly, until it is time for the program to actually create the window. At that point, the message “INFO: Initializing raylib 3.7” appears on the terminal, and it remains in that state without changing.

The .exe file is running, as evidenced by the fact that axe_game will show up in my task manager, and I will not be allowed to delete the file. It does not however appear to do anything, and will keep running until I tell VSCode to stop debugging.

it’s really hard to say what could be going on without more details (and honestly, more debugging output from Raylib which we’re not getting).

First thing to check, what are the specs of your PC?

Also, what happens if you use this code?

//Just use what's inside main, keep the rest of your program the same
int main()
{
    InitWindow(400, 400, "Test");

    while(!WindowShouldClose())
    {
          BeginDrawing();
          ClearBackground(WHITE);
          EndDrawing();
    }
}

Here’s what the debug console said with the code from my initial screenshot:

=thread-group-added,id=“i1”
GNU gdb (GDB) 8.1
Copyright (C) 2018 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later http://gnu.org/licenses/gpl.html
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type “show copying”
and “show warranty” for details.
This GDB was configured as “i686-w64-mingw32”.
Type “show configuration” for configuration details.
For bug reporting instructions, please see:
http://www.gnu.org/software/gdb/bugs/.
Find the GDB manual and other documentation resources online at:
http://www.gnu.org/software/gdb/documentation/.
For help, type “help”.
Type “apropos word” to search for commands related to “word”.
Warning: Debuggee TargetArchitecture not detected, assuming x86_64.
=cmd-param-changed,param=“pagination”,value=“off”
[New Thread 5976.0x7828]
[New Thread 5976.0x69d0]
[New Thread 5976.0x6240]
[New Thread 5976.0x6e24]
[New Thread 5976.0x64e0]
[New Thread 5976.0x75c4]

Thread 6 received signal SIGTRAP, Trace/breakpoint trap.
[Switching to Thread 5976.0x75c4]
0x77258de0 in ntdll!RtlUserThreadStart () from C:\Windows\SYSTEM32\ntdll.dll
Loaded ‘C:\Windows\SYSTEM32\ntdll.dll’. Symbols loaded.
Loaded ‘C:\Windows\System32\kernel32.dll’. Symbols loaded.
Loaded ‘C:\Windows\System32\KernelBase.dll’. Symbols loaded.
Loaded ‘C:\Windows\System32\gdi32.dll’. Symbols loaded.
Loaded ‘C:\Windows\System32\win32u.dll’. Symbols loaded.
Loaded ‘C:\Windows\System32\gdi32full.dll’. Symbols loaded.
Loaded ‘C:\Windows\System32\msvcp_win.dll’. Symbols loaded.
Loaded ‘C:\GameDev\Project\libgcc_s_dw2-1.dll’. Symbols loaded.
Loaded ‘C:\Windows\System32\ucrtbase.dll’. Symbols loaded.
Loaded ‘C:\Windows\System32\msvcrt.dll’. Symbols loaded.
Loaded ‘C:\Windows\System32\user32.dll’. Symbols loaded.
Loaded ‘C:\Windows\System32\shell32.dll’. Symbols loaded.
Loaded ‘C:\Windows\SYSTEM32\winmm.dll’. Symbols loaded.
Loaded ‘C:\Windows\SysWOW64\imm32.dll’. Symbols loaded.
Loaded ‘C:\Windows\SysWOW64\uxtheme.dll’. Symbols loaded.
Loaded ‘C:\Windows\SysWOW64\combase.dll’. Symbols loaded.
Loaded ‘C:\Windows\SysWOW64\rpcrt4.dll’. Symbols loaded.
Execute debugger commands using "-exec ", for example “-exec info registers” will list registers in use (when GDB is the debugger)

My pc is a laptop with Windows 11 as the OS.
The processor is: Intel Core i5-11400H
The graphics card is: NVIDIA GeForce RTX 3050 Laptop GPU
The memory is: 8 GB RAM

When using the code you’ve shown, the behavior appears identical in the terminal.
The main difference in the debug console is that there are 8 threads instead of 6, and the addition of these lines:

Loaded ‘C:\Windows\SysWOW64\dinput8.dll’. Symbols loaded.
Loaded ‘C:\Windows\SysWOW64\advapi32.dll’. Symbols loaded.
Loaded ‘C:\Windows\SysWOW64\sechost.dll’. Symbols loaded.
Loaded ‘C:\Windows\SysWOW64\bcrypt.dll’. Symbols loaded.
Loaded ‘C:\Windows\SysWOW64\XInput1_4.dll’. Symbols loaded.
Loaded ‘C:\Windows\SysWOW64\cfgmgr32.dll’. Symbols loaded.
Loaded ‘C:\Windows\SysWOW64\devobj.dll’. Symbols loaded.
Loaded ‘C:\Windows\SysWOW64\dwmapi.dll’. Symbols loaded.
Loaded ‘C:\Windows\SysWOW64\SHCore.dll’. Symbols loaded.
Loaded ‘C:\Windows\SysWOW64\T_Prevent.dll’. Symbols loaded.
Loaded ‘C:\Windows\SysWOW64\winspool.drv’. Symbols loaded.
Loaded ‘C:\Windows\SysWOW64\shlwapi.dll’. Symbols loaded.
Loaded ‘C:\Windows\SysWOW64\ole32.dll’. Symbols loaded.

Have you updated your video card drivers recently?

I just tried to update the drivers, and it says the best driver is already installed.

Can you try using the latest version of Raylib? I’m curious if this has something to do with Raylib 3.7 and Windows 11.

You’ll need to use our updated project template (ignore that it was updated for 4.0, an update for 5.0 has not been needed). To “uninstall” the previous versino of Raylib, all you need to do is delete the Raylib folder where it was installed.

As of switching to Raylib 4.0, it is now working.

Awesome! I’m glad we could come up with a solution for this.

Im using OSX and having a similar issue. When I go to run debugger on the Axe code it can’t find raylib.h

any help would be welcome.

You may need to modify the includePath in the c_cpp_properties.json file for the project to the path homebrew installed raylib into. You can type brew --cellar raylib into your terminal to get the exact path (the path changes depending on MacOS version)

Thanks for your reply.
I was able to find the path but changing it (adding) it to the json file didnt correct the problem.

However I was able to reinstall ray lib via brew and got things to work. so perhaps it was user error on the install.

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms