Jump to content

  • Log In with Google      Sign In   
  • Create Account

We're offering banner ads on our site from just $5!

1. Details HERE. 2. GDNet+ Subscriptions HERE. 3. Ad upload HERE.


SDL Release Build Problems


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
4 replies to this topic

#1 XsoodX   Members   -  Reputation: 135

Like
0Likes
Like

Posted 27 October 2012 - 12:46 PM

I have made a simple PONG game for my school project in VC++ 2010 using SDL. When i build the Release build inside VC++ it works perfectly fine, but when i try running the .exe from the solution folder, Nothing happens at all.

My SDL project does include .png files.

Can someone pls tell me how to build a proper release so that i can take it in a pendrive and install it on other comps?

Sponsor:

#2 Servant of the Lord   Crossbones+   -  Reputation: 20956

Like
1Likes
Like

Posted 27 October 2012 - 12:54 PM

For each of your assets (sounds, images, fonts, etc...) you are loading, do you do proper error checking and report the error messages in text files somewhere? What do the errors say?

Have you put the SDL libraries in the same folder as your executable?
It's perfectly fine to abbreviate my username to 'Servant' rather than copy+pasting it all the time.
All glory be to the Man at the right hand... On David's throne the King will reign, and the Government will rest upon His shoulders. All the earth will see the salvation of God.
Of Stranger Flames - [indie turn-based rpg set in a para-historical French colony] | Indie RPG development journal

[Fly with me on Twitter] [Google+] [My broken website]

[Need web hosting? I personally like A Small Orange]


#3 XsoodX   Members   -  Reputation: 135

Like
0Likes
Like

Posted 27 October 2012 - 12:57 PM

For each of your assets (sounds, images, fonts, etc...) you are loading, do you do proper error checking and report the error messages in text files somewhere? What do the errors say?

Have you put the SDL libraries in the same folder as your executable?


No, Just included the dll files, what all exactly do i have to put in the executable folder and how do i do the error checking?

#4 XsoodX   Members   -  Reputation: 135

Like
0Likes
Like

Posted 27 October 2012 - 01:09 PM

OK i got it working, just had to copy the image files,dlls and exe into a release folder inside another folder in my solution folder.

THANKS!

#5 Servant of the Lord   Crossbones+   -  Reputation: 20956

Like
0Likes
Like

Posted 27 October 2012 - 01:50 PM

Glad you got it working!

Just included the dll files, what all exactly do i have to put in the executable folder

You need:
  • The executable
  • The .dlls (on windows) in the same folder as the .exe
  • Your assets, in the correct path your game uses.
    (If you load a file as "./data/myImage.png" your game needs to have a 'data' folder next to the executable, with myImage.png inside it)

and how do i do the error checking?

Depends on the API. For SDL, something like this might work:
SDL_surface *myImage1 = SDL_LoadIMG("myImage1.png");
if(!myImage)
{
     //Uh oh, the image didn't load properly! Report an error.
     std::cerr << "Failed to load the image. SDL's error: " << SDL_GetError() << std::endl;
}
(This is from memory, so that code might not work)

SDL (I think) reroutes std::cout to a file called stdout.txt next to your program's executable, and std::cerr to a file called stderr.txt.

That needs to happen for almost every asset you load, otherwise it's harder to figure out where mistakes are.
Always make your program confirm that everything worked, and always make it report, detailedly, any deviation from your expectations. Make your program do your problem-solving for you.

You said in your first post, "when i try running the .exe from the solution folder, Nothing happens at all."
With computers, something always happens. You just can't always see it. Your work depends on whether you can find out what happened... and it's easier if you make your program just tell you the 'what' so you can focus on the more-important 'why'.

When my program runs, it tells me:
"Unable to find any file at "%GUI-PATH%/Editor/TilePlacementBar/TileDisplayWidget/BlendModes/Mask.png", in any mod, expansion, or the main game folder."

Or:
"Trying to get a chunk that isn't loaded.
Area: 'Untitled'
VisibleChunkLoc: (0, 0)"

The more detailed your program's error reporting is, the quicker you find where the errors are, and the sooner you fix them. Some people's error reporting includes italics/bold/underlining, text coloration, and other stuff to make it even easier to identify what's wrong. I currently output mine as .rtf files, but HTML and CSS files are also commonly used (and I want to migrate to those myself in the future), but even plaintext can save you hours of work.
It's perfectly fine to abbreviate my username to 'Servant' rather than copy+pasting it all the time.
All glory be to the Man at the right hand... On David's throne the King will reign, and the Government will rest upon His shoulders. All the earth will see the salvation of God.
Of Stranger Flames - [indie turn-based rpg set in a para-historical French colony] | Indie RPG development journal

[Fly with me on Twitter] [Google+] [My broken website]

[Need web hosting? I personally like A Small Orange]





Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS