SFML community forums

Help => General => Topic started by: Kain Nobel on February 25, 2023, 10:30:27 am

Title: Fresh Start II / Application Window Doesn't Launch
Post by: Kain Nobel on February 25, 2023, 10:30:27 am
(click to show/hide)

Current Situation: Everything builds correctly but no application window is launched. I got rid of the ".a" extensions in Debug and Release. I've also noticed my std::cout message doesn't get printed to the console, so hm.

Here is a video of the problem...

(click to show/hide)

EDIT: Another day, another video. The same problem, application window won't display and my std::cout statements aren't printing so something is a disconnect. I'm not sure what exactly. I'm just not cool enough for this...

https://www.youtube.com/watch?v=uPRpKegjjsk

(click to show/hide)
Title: Re: Fresh Start II / Application Window Doesn't Launch
Post by: Stauricus on February 26, 2023, 01:06:21 pm
doesn't seems to be a big deal. take some printscreens to help finding the problem:
1- your folder containing the lib files
2- in project Build Options, print of "compiler settings", "linker settings", and "search directories"
Title: Re: Fresh Start II / Application Window Doesn't Launch
Post by: Kain Nobel on February 26, 2023, 04:08:31 pm
I've made a video just to demonstrate current behavior. Images of settings are in the spoilers below the video.

https://www.youtube.com/watch?v=kkcRsYwaPQ8
(I do apologize, apparently I didn't have the microphone plugged in. Shouldn't matter too much, I'm just showing the current setup.)

SFML location is @ "C:/SFML/2.5.1/", a pretty standard location.


This is a frustrating issue because I'm fairly confident I've done everything correctly. I've exhausted the tutorial and searches for similar situations via google. I'm laughing that I'm stuck on such a pedestrian issue, I've never spent so long on something so stupid lol

(click to show/hide)
(click to show/hide)
(click to show/hide)
Title: Re: Fresh Start II / Application Window Doesn't Launch
Post by: Stauricus on February 26, 2023, 05:07:21 pm
your code is getting to the point it returns 0. i cant be sure in the video, but didn't you typed
while (window.isOpen())}
instead of
while (window.isOpen()){
?
EDIT: NVM, its right. the video quality was confusing me about it.


try changing libsfml-graphics-d for sfml-graphics-d (and also do it for window, audio, and system) in linker settings.
Title: Re: Fresh Start II / Application Window Doesn't Launch
Post by: Kain Nobel on February 26, 2023, 05:22:43 pm
OK, I did just that and now I'm getting the exit code 5 again.

I switched it back so I get the old error (exit 0 success).

I notice it does say...

Quote
"Starting the debuggee failed: No executable specified, use `target exec'."

So do I have to do something else? Sorry I'm rusty with the "setup" it's been a while lol. I'll have to get refreshed with the debugger again, I usually just do std::cout tests :3

(click to show/hide)
Title: Re: Fresh Start II / Application Window Doesn't Launch
Post by: Stauricus on February 26, 2023, 05:33:35 pm
when that happens, in the tabs in the bottom of Code Blocks you have one called 'build messages'. what is in it?
Title: Re: Fresh Start II / Application Window Doesn't Launch
Post by: Kain Nobel on February 26, 2023, 05:54:15 pm
Without "lib" prefixed: When I get an exit code 5...

(click to show/hide)

With "lib" prefixed: When I get an exit code 0...

(click to show/hide)

NOTE : OpenAL32.dll is located in Global compiler settings and is also set in the Environment Variables Path setting. I don't know if this is relevant to the situation, it might not be, but I figured I'd put the info out there in case it is of relevance.
Title: Re: Fresh Start II / Application Window Doesn't Launch
Post by: Stauricus on February 26, 2023, 06:01:49 pm
try removing the audio libs from the linker settings for now. they are not in the right order anyway (the sfml-audio should be on top of window and system; order matters in this case). remove sfml-audio and the openall.dll and testing it again.
Title: Re: Fresh Start II / Application Window Doesn't Launch
Post by: Kain Nobel on February 26, 2023, 06:09:30 pm
Ah! You might be on to something, now I'm starting to get a lot more errors. (As odd as that sounds, this might be a good thing...)

Something is incompatible it seems. Hm.

(click to show/hide)

EDIT : I've switched from GNU GCC to TDM-GCC-32 because that's what I think it's *supposed* to use, if I'm not having tutorial amnesia lol

I'm using "GCC 5.1.0 TDM (SJLJ) - Code::Blocks - 32-bit"
(click to show/hide)

The two build logs may look similar, but the 2nd one appears to have less errors (6 skipping VS 3 skipping)
Title: Re: Fresh Start II / Application Window Doesn't Launch
Post by: Stauricus on February 26, 2023, 06:19:43 pm
yes, it may be related to incompatible compiled sfml and the compiler you are using.
lets see what G++ compiler you have. open the Windows prompt (cmd) and type g++ -v or g++ --version
Title: Re: Fresh Start II / Application Window Doesn't Launch
Post by: Kain Nobel on February 26, 2023, 06:25:52 pm
OK looks like it is 5.1.0

(click to show/hide)
Title: Re: Fresh Start II / Application Window Doesn't Launch
Post by: Stauricus on February 26, 2023, 07:21:24 pm
hmm... have you tried building SFML from source?

which SFML version did you download?

and what CodeBlocks version did you download? is it the one that includes MinGW for default?
Title: Re: Fresh Start II / Application Window Doesn't Launch
Post by: Kain Nobel on February 26, 2023, 07:36:40 pm
I got it from SFML and Code::Blocks (MinGW) (https://en.sfml-dev.org/tutorials/2.5/start-cb.php) tutorial. The compiler is the GCC 5.1.0 TDM (SJLJ) - Code::Blocks - 32-bit (https://www.sfml-dev.org/files/SFML-2.5.1-windows-gcc-5.1.0-tdm-32-bit.zip). This is the compiler installed at "C:/TDM-GCC-64" (which I've renamed to 32 just now.) For TDM, there is only the 5.1 on my drive, no 10.3 exists anymore.

In my previous thread (link (https://en.sfml-dev.org/forums/index.php?topic=28907.0)) I was trying to build from source. That's not the case now. That's an unrelated topic (but I may return to it because I would like to learn how to do that (again?))
Title: Re: Fresh Start II / Application Window Doesn't Launch
Post by: Stauricus on February 26, 2023, 08:42:55 pm
it seems right to me... are you using SFML_STATIC?
Title: Re: Fresh Start II / Application Window Doesn't Launch
Post by: Kain Nobel on February 26, 2023, 08:45:43 pm
No.
Title: Re: Fresh Start II / Application Window Doesn't Launch
Post by: Stauricus on February 26, 2023, 09:05:49 pm
wow, i see one thing that is wrong. in your search directories, remove the trailing backslash
i.e. change C:\SFML\2.5.1\include\ for C:\SFML\2.5.1\include
(do it for linker and include)

in your linker settings, keep just this:
sfml-graphics-d
sfml-window-d
sfml-system-d
Title: Re: Fresh Start II / Application Window Doesn't Launch [Solved]
Post by: Kain Nobel on February 27, 2023, 07:46:13 am
I appreciate your help, sorry I had to leave for a bit and do some adulting lol

This Build information in the two spoilers below is from the the suggestion, done exactly as stated. I've formated to the sfml-<library>-d in Linker and I've removed the \ from the end of the Search Directories (include and lib folder paths.) I tested to see if swapping them for / made a difference but it doesn't seem to.

(click to show/hide)
(click to show/hide)

Behind the scene, I've checked filepaths, made sure the compiler (TDM GCC 5.1) was good, made sure the proper files were in compiler's bin/ folder, etc. It seems to all check out.

So one thing I have discovered is it seems Code::Blocks seems to need the filepaths to be dictated by manually selecting them with the mouse. When the project is built with these settings, it unlocks 20 shiny errors of hope. In other words, I have to do...


...and I get...

(click to show/hide)

And that's all I've got for now.

NOTE: These are the next steps, then I'll be updating the topic.


EDIT: OK, so it looks like we're good now. I did have to uninstall / reinstall something (IDE and/or Compiler). Thank you for your help, we can stick a fork in it now :D
Title: Re: Fresh Start II / Application Window Doesn't Launch
Post by: Stauricus on February 27, 2023, 12:43:31 pm
thats it, we're officially in linker errors now.
first you could try setting SFML_STATIC, as in the tutorials (I believe its the standard for Windows users)

EDIT: oh wait, did it work then?   ;D