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

Author Topic: Start from .exe  (Read 2630 times)

0 Members and 1 Guest are viewing this topic.

Bytemare

  • Newbie
  • *
  • Posts: 4
    • View Profile
Start from .exe
« on: October 18, 2019, 12:13:56 pm »
Hey,
I devolped a little game with SFML and C++.
My IDE is Visual Studio.

My problem:
When I start my program with visual studio (there's no differents between debug or release mode)
everything's working just fine and I got no errors.

But if I start the program with the .exe in my project folder, at one point of the program, it crashes
and I get no response.

My question is: What kind of problem could it be and why I just get that error, when starting with .exe?
And is it possible to debug the .exe some how?

I tried the following:
I started the exe and opened the task manager. Right click on the task and "debug" with Visual Studio.
But VS says that everything's fine. I got no error messages.

So what can I do to find the bug?

greetings
Bytemare

nogoodname

  • Newbie
  • *
  • Posts: 21
    • View Profile
Re: Start from .exe
« Reply #1 on: October 18, 2019, 04:23:41 pm »
Do you load assets (e.g. texture, sounds, etc) in your program? Are they in same directory as your .exe?

Try modifying your project working directory.
« Last Edit: October 18, 2019, 04:32:09 pm by nogoodname »

Bytemare

  • Newbie
  • *
  • Posts: 4
    • View Profile
Re: Start from .exe
« Reply #2 on: October 25, 2019, 11:09:26 pm »
Hey. Sry for the late answer, but no it wasnt the assets. All pathes are correct. If the assets not right, the debug version would be false too.

Hapax

  • Hero Member
  • *****
  • Posts: 3346
  • My number of posts is shown in hexadecimal.
    • View Profile
    • Links
Re: Start from .exe
« Reply #3 on: October 28, 2019, 01:33:13 am »
So the debug build works fine when executed directly from the exe file but not the release build?

Just to clarify, you didn't say whether the exe in your project folder is the release or debug version.
Selba Ward -SFML drawables
Cheese Map -Drawable Layered Tile Map
Kairos -Timing Library
Grambol
 *Hapaxia Links*

Bytemare

  • Newbie
  • *
  • Posts: 4
    • View Profile
Re: Start from .exe
« Reply #4 on: October 29, 2019, 10:15:14 am »
Hey, okay maybe I have to clarify it more:

When Visual Studio is open and I use ctrl + F5 to start my game, everything's working fine. There are no differents between debug and release. Both working fine.

But when I start the game directly from my folder, where the compiled exe is, the game got a runtime error at on specific point (it's when a player is game over and the game state switch to the game over screen).

I use the assets with the following style:

texture.loadFromFile("Assets\\anotherAssetFolder\\tex.png")
 

My Folder looks like this:

Assets [folder]
Game [folder]
Debug [folder]
 - Assets [folder]
 - game.exe
 - all relevant sfml dll's
Release [folder]
 - the same as in debug folder
game.sln [project]

I dont think that the Asset folder is the problem, because I would get loading errors in my visual studio too.
and why only at the game over screen. Everything else before starts correctly.

Thanks for your help
Bytemare

Bytemare

  • Newbie
  • *
  • Posts: 4
    • View Profile
Re: Start from .exe
« Reply #5 on: October 29, 2019, 11:34:17 am »
Okay, now I've got the issue.
The probem was the highscore.hsc file. I forgot to put it into the debug/release folder.
Dumb fail  ::) :-X

But thx for your response.

Hapax

  • Hero Member
  • *****
  • Posts: 3346
  • My number of posts is shown in hexadecimal.
    • View Profile
    • Links
Re: Start from .exe
« Reply #6 on: October 31, 2019, 10:44:56 pm »
No worries. Glad you managed to solve your problem! :D
Selba Ward -SFML drawables
Cheese Map -Drawable Layered Tile Map
Kairos -Timing Library
Grambol
 *Hapaxia Links*

 

anything