Supriya Samanta
|
Not able to run photon in VmWare
|
Supriya Samanta
11/14/2011 4:22 AM
post90064
|
Not able to run photon in VmWare
Hi
I am trying to run one simple photon code in vmware.
#include <stdlib.h>
#include <stdio.h>
#include <Pt.h>
int main( int argc, char *argv[] )
{
PtArg_t args[3];
int n;
PtWidget_t *window;
int push_button_cb( PtWidget_t *, void *,
PtCallbackInfo_t *);
PtCallback_t callbacks[] = {{push_button_cb, NULL}};
char Helvetica14[MAX_FONT_TAG];
if (PtInit(NULL) == -1)
PtExit(EXIT_FAILURE);
window = PtCreateWidget(PtWindow, Pt_NO_PARENT, 0, NULL);
n = 0;
PtSetArg(&args[n++], Pt_ARG_TEXT_STRING,
"Press to exit", 0);
/* Use 14-point, bold Helvetica if it's available. */
if(PfGenerateFontName("Helvetica", 0, 14,
Helvetica14) == NULL) {
perror("Unable to generate font name");
} else {
PtSetArg(&args[n++], Pt_ARG_TEXT_FONT, Helvetica14, 0);
}
PtSetArg(&args[n++], Pt_CB_ACTIVATE, callbacks,
sizeof(callbacks)/sizeof(callbacks[0]));
PtCreateWidget(PtButton, window, n, args);
PtRealizeWidget(window);
PtMainLoop();
return (EXIT_SUCCESS);
}
int
push_button_cb(PtWidget_t *w, void *data,
PtCallbackInfo_t *cbinfo)
{
printf( "I was pushed\n" );
PtExit( EXIT_SUCCESS );
/* This line won't be reached, but it keeps
the compiler happy. */
return( Pt_CONTINUE );
}
but when I try to run it in vmware i am getting some error.
waht to do?
|
|
|