The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Operating Systems > Linux
.
google unix.com



Linux RedHat, Ubuntu, SUSE, Fedora, Debian, Mandriva, Slackware, Gentoo linux, PCLinuxOS. All Linux questions here!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
How do i Execute DirectFB programs on Ubuntu Ravikishore Ubuntu 15 10-05-2009 07:42 PM
Executing a Java Program hypnotic_meat Shell Programming and Scripting 2 04-16-2009 10:15 AM
Trubble in executing the cpp program... ps_sach High Level Programming 3 10-21-2008 10:04 AM
Executing an .ec program in different informix versions matrixmadhan High Level Programming 0 05-21-2005 06:29 AM
executing the su command from a java program. shailendrat UNIX for Dummies Questions & Answers 1 03-24-2005 12:27 PM

Reply
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 09-10-2009
Ravikishore Ravikishore is offline
Registered User
  
 

Join Date: Aug 2009
Posts: 29
Exclamation Error while executing Directfb program on ubuntu

Hi ,
I am getting error while executing Directfb program on ubuntu ,,
my program is :

#include <stdio.h>
#include <unistd.h>



#include <directfb.h>



static IDirectFB *dfb = NULL;
static IDirectFBSurface *primary = NULL;
static int screen_width = 0;
static int screen_height = 0;
#define DFBCHECK(x...)
{
DFBResult err = x;

if (err != DFB_OK)
{
fprintf( stderr, "%s <%d>:\n\t", __FILE__, __LINE__ );
DirectFBErrorFatal( #x, err );
}
}
int main (int argc, char **argv)
{
int i;



DFBSurfaceDescription dsc;

IDirectFBImageProvider *provider;



DFBCHECK (DirectFBInit (&argc, &argv));
DFBCHECK (DirectFBCreate (&dfb));
DFBCHECK (dfb->SetCooperativeLevel (dfb, DFSCL_FULLSCREEN));
dsc.flags = DSDESC_CAPS;
dsc.caps = DSCAPS_PRIMARY | DSCAPS_FLIPPING;
DFBCHECK (dfb->CreateSurface( dfb, &dsc, &primary ));
DFBCHECK (primary->GetSize (primary, &screen_width, &screen_height));
DFBCHECK (dfb->CreateImageProvider (dfb, DATADIR"/dfblogo.png", &provider));

DFBCHECK (provider->GetSurfaceDescription (provider, &dsc));

DFBCHECK (dfb->CreateSurface( dfb, &dsc, &logo ));

DFBCHECK (provider->RenderTo (provider, logo, NULL));
provider->Release (provider);
for (i = -dsc.width; i < screen_width; i++)
{
DFBCHECK (primary->FillRectangle (primary, 0, 0, screen_width, screen_height));
DFBCHECK (primary->Blit (primary, logo, NULL, i, (screen_height - dsc.height) / 2));

DFBCHECK (primary->Flip (primary, NULL, DSFLIP_WAITFORSYNC));
}
logo->Release (logo);

primary->Release (primary);
dfb->Release (dfb);

return 23;
}

im compiling this program by
root@lxdevenv:~/Desktop# gcc a.c -o a -I/usr/local/include/directfb -L/usr/local/include/lib -lX11 -lXi -lXmu -lglut -lGL -lGLU

i am getting the following Error as below
root@lxdevenv:~/Desktop# gcc a.c -o a -I/usr/local/include/directfb -L/usr/local/include/lib -lX11 -lXi -lXmu -lglut -lGL -lGLU
a.c:15: error: expected identifier or ‘(’ before ‘{’ token
a.c:21: error: stray ‘#’ in program
a.c: In function ‘main’:
a.c:39: error: expected ‘;’ before ‘dsc’
a.c:58: error: ‘logo’ undeclared (first use in this function)
a.c:58: error: (Each undeclared identifier is reported only once
a.c:58: error: for each function it appears in.)
root@lxdevenv:~/Desktop#

guide me how to compile this program..
any answer will appreciated.........
Reply

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 12:38 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0