473,771 Members | 2,372 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

SDL first try problem!!

Hi all,
i', tryng to make this code work .....

it compiles but , when i exec, i've got Segmentation Fault

Where i was wrong???
(i'm using Gcc)

my C code:

#include <SDL/SDL.h>
#include <SDL/SDL_image.h>
#include <stdio.h>
int main(void){

const SDL_VideoInfo *vInfo;

vInfo= SDL_GetVideoInf o ();

if ( vInfo->hw_available )
printf("HW: OK");
}

Nov 23 '05 #1
7 1493
Ivan wrote:
my C code:

#include <SDL/SDL.h>
#include <SDL/SDL_image.h>


http://www.ungerhu.com/jxh/clc.welcome.txt

See if you can find a newsgroup
where somebody should know what SDL is.

--
pete
Nov 23 '05 #2

Ivan wrote:
Hi all,
i', tryng to make this code work .....

it compiles but , when i exec, i've got Segmentation Fault

Where i was wrong???
(i'm using Gcc)

my C code:

#include <SDL/SDL.h>
#include <SDL/SDL_image.h>
#include <stdio.h>
int main(void){

const SDL_VideoInfo *vInfo;

vInfo= SDL_GetVideoInf o ();

if ( vInfo->hw_available )
printf("HW: OK");
}


Details of how SDL (whatever it is) are not on topic
in comp.lang.c. If your problem is in SDL, you should
find a newsgroup that does that.

One generic C problem that could cause you woe is if
SDL_GetVideoInf o returns NULL. Perhaps you could
add a check for that prior to dereferencing the pointer?

-David

Nov 23 '05 #3
OOPS -_-'

i'm sorry ^_^

Nov 23 '05 #4
Ivan wrote:
#include <SDL/SDL.h>
#include <SDL/SDL_image.h>
#include <stdio.h>
int main(void){

const SDL_VideoInfo *vInfo;

vInfo= SDL_GetVideoInf o ();

if ( vInfo->hw_available )
printf("HW: OK");
}


<off-topic>
You first have to initialize the library with SDL_Init.
</off-topic>
August

--
I am the "ILOVEGNU" signature virus. Just copy me to your
signature. This email was infected under the terms of the GNU
General Public License.
Nov 23 '05 #5
tnx August ^_^

Nov 23 '05 #6
"Ivan" <iv*******@hotm ail.com> wrote in message
news:11******** *************@f 14g2000cwb.goog legroups.com...
Hi all,
i', tryng to make this code work .....

it compiles but , when i exec, i've got Segmentation Fault

Where i was wrong???


When using a third-party library, it usually
helps tremendously to Read The Directions
before using.

-Mike

Nov 23 '05 #7
Ivan wrote:
OOPS -_-'

i'm sorry ^_^


Opps what? Sorry for what? Did you stub your toe and are now sorry for
doing so? Did you spend a little more of your check than you should have
and are now sorry that you are broke? Please provide enough context of
the previous post for others to know what you are replying to. Not all
news servers store the previous messages in a thread, therefore not all
others are able to go back to the previous article.

Joe
Nov 23 '05 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
2460
by: PT | last post by:
I got a form with many text boxes, checkboxes and 3 drop downs. From that 3, 2 are dependant. I can choose one drop down, and the next drop down should display the dependant values of the first drop down chosed. And I have a submite button to submit all these values to DB. First problem: I cant keep the value of the selected text in the first drop down. It always goes back to the first value. (but the asp site extension changes...
6
5879
by: John Morgan | last post by:
I urgently need tom use SP3a upgrade the instance of SQLServer200 MSDE runing on my local machine but I am having problems in doing so. My first problem is that when I start the set up procedure I get the message "A strong SA password is required for security reasons. Please use SAPWD switch to supply the same" Currently the sa password is Abc/def/ghk1
6
5100
by: neptune | last post by:
I must be missing something obvious. I have 3 fields and sample data. 7890 26592 7/15/2003 7890 13645 10/6/1999 7890 58741 6/21/1992 I want to select only the most recent record. It is sorted descending by in the query and subquery. In the query Total, I select Group By , First and First
0
1910
by: Jim | last post by:
I am having some trouble with user controls and would appreciate any input / advice on where to go with this... :) 1. The first problem, and perhaps the root of the others, is that I have several user controls that are inherited user controls, based on one class, which is in turn based on System.Windows.Forms.UserControl. We'll call this class "UserControlBase". My first problem is that UserControlBase implements some public...
1
2580
by: Kamal Jeet Singh | last post by:
Hi Friends !! I am facing problem in controlling the dynamically created controls on web page. The problem Scenario is Scenario:- My requirement is to load the web user controls on the web page dynamically. To do this, First I including a web page (MainPage.aspx) and I made form tag to Runat=Server. I included one table tag and also made this table Runat=Server side. Second I created three Web User Controls e.g. wucCustomerInfo.ascx,
1
1639
by: funfair | last post by:
HI,EVERY ONE first problem, i have create a database in access 2003 it worked fine untill i have format my laptop . now im working on office 2003 on windows xp and i have norton 2006 but im facing a problem in opening some forms from command button a message appear the openform action was canceled and when i open them from the database window(form) there are problem in open event or change event or activate event the same file is work...
0
1265
by: Kaur | last post by:
Hi, I am having problem trying to go to same record when I close 3rd form. I have a form called frmDepartment. This form has a list box that displays all the departments. Clicking on one of the departments opens up second form called frmEmployees. This form displays all the employees for the department selected in frmDepartment. This form has an unbound list box which retreives all the values from a query and displays all the names of...
16
4830
by: Martin Joergensen | last post by:
Hi, I wanted to try something which I think is a very good exercise... I read in data from the keyboard and store them in a structure. There's a pointer called "data_pointer" which I use to keep track on the structures... But it's a bit confusing - my program won't compile and I don't know what to do about the warnings/error messages. c:\documents and settings\dell\Desktop\test\main.c(5) : warning
11
3666
by: coomberjones | last post by:
I have a few std::strings that I am using to store raw binary data, each of which may very well include null bytes at any point or points. I want to slap them together into a single string, so I tried a std::ostringstream: std::ostringstream oss; oss << x << y << z; std::string result ( oss.str() ); The result shows that feeding the ostringstream with a string just
87
3751
by: pereges | last post by:
I have a C program which I created on Windows machine. I have compiled and executed the program on windows machine and it gives me the consistent output every time i run it. for eg. input a = 2, b =3 lets say a sum operation is to be performed, then: output: 5
0
9454
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10261
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10103
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10038
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9911
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8934
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7460
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6713
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
3
2850
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.