LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 09-13-2005, 04:10 PM   #1
crosseyedalien
LQ Newbie
 
Registered: Nov 2004
Location: East Windsor, NJ
Distribution: Mandriva
Posts: 18

Rep: Reputation: 0
segmentation faults with SDL


I'm looking for some general help when using SDL. I can get various tutorial examples to compile no problem, but it seems that whenever I start creating my own program I run into segmentation faults that seem to occur right on (or in) the SDL functions. The latest one has happened right on SDL_UpdateRect or SDL_UpdateRects, it didn't matter which one I used. I have riddled my code with excessive error checking and I have verified that my pointers are valid.

The one major difference I have seen between my code and SDL tutorial code in general is that I tend to avoid external variables at all costs, whereas the online code tends to use them quite liberally. Are there some memory management advantages to using external variables with SDL? Maybe in particular the SDL_Surface pointer that is returned from SDL_SetVideoMode?

My code is on a private network, otherwise I would go ahead and post it. So I'm just hoping that maybe somebody may have encountered something similar and might have some ideas.

Thanks for any suggestions and I apologize for the rather vague and open-ended question.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Some help with segmentation faults? captainslushie Linux - Software 5 06-23-2005 02:59 PM
Segmentation Faults. Terroth Linux - Hardware 1 06-19-2005 05:16 AM
Segmentation Faults ryankask Mandriva 2 06-13-2005 07:10 PM
Segmentation Faults? DoomsdayChef Linux - Newbie 2 10-18-2003 08:18 AM
Segmentation Faults? floyd Linux - General 5 09-01-2003 11:54 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 12:02 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration