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

Author Topic: [SOLVED] SFML shows only white screen  (Read 300 times)

0 Members and 1 Guest are viewing this topic.

dimon98165

  • Newbie
  • *
  • Posts: 1
    • View Profile
    • Email
[SOLVED] SFML shows only white screen
« on: December 01, 2024, 08:15:58 am »
Hello there, today i reinstalled the window after getting a virus. But i found out the project had stopped being compiled normally. Both G++(Compiler) and Collect2(Linker) doesn't show any both problems and issues there.

heres code:
```
#include <SFML/Graphics.hpp>
#include <parent_directory_finder_win64.hpp>
#include <fstream>
#include <filesystem>
#include <vector>
#include <main_functions.hpp>
#include <thread>
#include <functional>
#include <boost/asio.hpp>
#include <map>

int main(int argc, char** argv)
{
    P_Directory_Finder_win64 path(argc, argv);
    sf::RenderWindow window(sf::VideoMode(400, 400), "utail checker", sf::Style::Titlebar);
    window.setFramerateLimit(60);

    while (window.isOpen())
    {
        //главная часть
        sf::Event event;
        while (window.pollEvent(event))
        {
            if (event.type == sf::Event::Closed){
                window.close();
                exit(0);
            }
        }

        window.clear(sf::Color::Black);
        window.display();
    };
    return 0;
}
```

but heres script of .bat file:
```
g++ -I"client/win64/libraries/SFML-2.6.1/include" -static -c "client/win64/source/utail_client.cpp" -I"client\win64\libraries\headers" -I"client/win64/libraries/boost_1_86_0"

g++ -static -o "client/win64/utail_client.exe" "utail_client.o" "assets/icon.o" -L"client/win64/libraries/SFML-2.6.1/lib" -l:libsfml-window.a -l:libsfml-system.a -l:libsfml-graphics.a -l:libstdc++.a -l:libgcc.a -lws2_32
```

everything worked fine until i got viruses.... I had to reinstall OS... And the main problem is that SFML library doesnt show any images in it, but also just getting closed after a few seconds with error level: "-1073740940". I think its problem of version of new compiler which i downloaded earlier, because i havent changed anything in my project before reinstalling windows os. The fact is my project worked correctly until this. The version of new compiler which i downloaded is 14.2.0.

i checked my programm with GDB(GNU DEBUGGER) and it says that:
```
Starting program: C:\Users\сшсюэ\Desktop\utail_v0.9\client\win64\utail_client.exe
[New Thread 4436.0x36e0]
[New Thread 4436.0x38a4]
[New Thread 4436.0x2ba0]
warning: while parsing target library list: not well-formed (invalid token)
warning: while parsing target library list: not well-formed (invalid token)
warning: while parsing target library list: not well-formed (invalid token)
warning: while parsing target library list: not well-formed (invalid token)
warning: while parsing target library list: not well-formed (invalid token)
warning: while parsing target library list: not well-formed (invalid token)
warning: while parsing target library list: not well-formed (invalid token)
warning: while parsing target library list: not well-formed (invalid token)
warning: while parsing target library list: not well-formed (invalid token)
[New Thread 4436.0x1b24]
warning: while parsing target library list: not well-formed (invalid token)
warning: while parsing target library list: not well-formed (invalid token)
warning: while parsing target library list: not well-formed (invalid token)
warning: while parsing target library list: not well-formed (invalid token)
warning: while parsing target library list: not well-formed (invalid token)
warning: while parsing target library list: not well-formed (invalid token)
warning: while parsing target library list: not well-formed (invalid token)
warning: while parsing target library list: not well-formed (invalid token)
[New Thread 4436.0xb98]
warning: while parsing target library list: not well-formed (invalid token)
warning: while parsing target library list: not well-formed (invalid token)
warning: while parsing target library list: not well-formed (invalid token)
warning: while parsing target library list: not well-formed (invalid token)
warning: while parsing target library list: not well-formed (invalid token)
warning: while parsing target library list: not well-formed (invalid token)
warning: while parsing target library list: not well-formed (invalid token)
warning: while parsing target library list: not well-formed (invalid token)
warning: while parsing target library list: not well-formed (invalid token)
warning: while parsing target library list: not well-formed (invalid token)
warning: while parsing target library list: not well-formed (invalid token)
warning: while parsing target library list: not well-formed (invalid token)
warning: while parsing target library list: not well-formed (invalid token)
[New Thread 4436.0x27b0]
[New Thread 4436.0x2d50]
[Thread 4436.0xb98 exited with code 0]
[Thread 4436.0x27b0 exited with code 0]
[Thread 4436.0x2d50 exited with code 0]
[New Thread 4436.0x22b8]
[New Thread 4436.0x3b00]
warning: while parsing target library list: not well-formed (invalid token)
warning: while parsing target library list: not well-formed (invalid token)
warning: while parsing target library list: not well-formed (invalid token)
warning: while parsing target library list: not well-formed (invalid token)
warning: while parsing target library list: not well-formed (invalid token)
warning: while parsing target library list: not well-formed (invalid token)
warning: while parsing target library list: not well-formed (invalid token)
warning: while parsing target library list: not well-formed (invalid token)
warning: while parsing target library list: not well-formed (invalid token)
[New Thread 4436.0x167c]
warning: while parsing target library list: not well-formed (invalid token)
warning: while parsing target library list: not well-formed (invalid token)
warning: while parsing target library list: not well-formed (invalid token)
warning: while parsing target library list: not well-formed (invalid token)
warning: while parsing target library list: not well-formed (invalid token)
warning: while parsing target library list: not well-formed (invalid token)
warning: while parsing target library list: not well-formed (invalid token)
warning: while parsing target library list: not well-formed (invalid token)
warning: while parsing target library list: not well-formed (invalid token)
warning: while parsing target library list: not well-formed (invalid token)
warning: while parsing target library list: not well-formed (invalid token)
warning: while parsing target library list: not well-formed (invalid token)
warning: while parsing target library list: not well-formed (invalid token)
warning: while parsing target library list: not well-formed (invalid token)
warning: while parsing target library list: not well-formed (invalid token)
warning: while parsing target library list: not well-formed (invalid token)
warning: while parsing target library list: not well-formed (invalid token)
[New Thread 4436.0x30a8]
warning: while parsing target library list: not well-formed (invalid token)
warning: while parsing target library list: not well-formed (invalid token)
[New Thread 4436.0x3690]
warning: while parsing target library list: not well-formed (invalid token)
warning: while parsing target library list: not well-formed (invalid token)
warning: while parsing target library list: not well-formed (invalid token)
warning: while parsing target library list: not well-formed (invalid token)
[New Thread 4436.0x36a4]
warning: while parsing target library list: not well-formed (invalid token)
warning: while parsing target library list: not well-formed (invalid token)
warning: while parsing target library list: not well-formed (invalid token)
warning: HEAP[utail_client.exe]:
warning: Invalid address specified to RtlFreeHeap( 00000000006D0000, 0000000000F641C0 )

Thread 1 received signal SIGTRAP, Trace/breakpoint trap.
0x00007ffd7d096f0f in ?? ()
```

solve:
i just needed to download the G++ of version 13.1.0 whish can be downloaded from SFML website. So it finnaly works for me... thankfully it does....
« Last Edit: December 03, 2024, 03:43:27 pm by dimon98165 »

kojack

  • Sr. Member
  • ****
  • Posts: 344
  • C++/C# game dev teacher.
    • View Profile
Re: SFML shows only white screen
« Reply #1 on: December 03, 2024, 11:25:27 am »
One important thing when using GCC (G++) is the version of the compiler you use to build the app must be identical to the version used to build SFML.
The only prebuilt SFML downloads for GCC are for version 13.1.0. So you must get that compiler (not 14.2.0) or you need to build SFML from source yourself using 14.2.0.

(Visual Studio used to have a similar issue with versions, but they don't any more).

 

anything