- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Compile switch.c Problem
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-12-2006 02:58 AM
04-12-2006 02:58 AM
Here is the source:
/* include files */
#include
#include
#include
/* functions */
void main(int, char**);
void ws_change(Widget widget, Atom aWorkspace, XtPointer client_data);
/* global variables */
static XmString xms;
static Widget toplevel;
static Widget *wWs;
static Atom *paWsSet = NULL;
static unsigned long numWorkspaces;
static Atom *paWs;
static Display *display;
static Window root;
static int screen;
static Widget top, form, top1;
static XtAppContext app_context;
static Arg args[10];
static int n, i, status, pNumWorkspaces;
static Atom *ppaWorkspaces, foundWsAtom = NULL;
static DtWsmWorkspaceInfo *ppWsInfo;
static DtWsmCBContext wsmcontext;
static char *desiredWs;
/* main - main logic for program */
void main (int argc, char **argv)
{
/* initialize toolkit */
n = 0;
XtSetArg (args[n], XmNallowShellResize, True); n++;
XtSetArg (args[n], XtNmappedWhenManaged, False); n++;
toplevel = XtAppInitialize (&app_context, "Dtswitch", NULL, 0,
&argc, argv, NULL, args, n);
display = XtDisplay(toplevel);
screen = DefaultScreen(display);
root = RootWindow(display, screen);
XSynchronize(display, screen);
if ( argc != 2 )
{
printf("must provide name of a workspace to switch to\n");
printf("we'll just monitor workspace changes now\n");
desiredWs = NULL;
}
else
{
desiredWs = argv[1];
}
status = DtWsmGetWorkspaceList(display, root, &ppaWorkspaces,
&pNumWorkspaces);
if (status != Success )
{
printf("problem obtaining workspace list, exiting with status %d\n",
status);
exit(status);
}
/*
printf("Number of workspaces returned is %d\n", pNumWorkspaces);
*/
for (i=0;i
status = DtWsmGetWorkspaceInfo(display, root, ppaWorkspaces[i],
&ppWsInfo);
if (status != Success )
{
printf("problem getting workspace info %d\n", status);
}
else
{
printf("Workspace %d , title is %s, name is %s\n",i,
ppWsInfo->pchTitle,
XGetAtomName(display,ppWsInfo->workspace));
if ((desiredWs != NULL) &&
(0 == strcmp(desiredWs, ppWsInfo->pchTitle)))
{
foundWsAtom = ppWsInfo->workspace;
}
}
}
wsmcontext = DtWsmAddCurrentWorkspaceCallback(toplevel, ws_change, NULL);
/*
printf("wsmcontext is %d\n", wsmcontext);
*/
XtRealizeWidget (toplevel);
if (foundWsAtom != None)
{
printf("Atom is %x, name is %s\n",
foundWsAtom,XGetAtomName(display, foundWsAtom));
XFlush(display);
status = DtWsmSetCurrentWorkspace(toplevel, foundWsAtom);
XFlush(display);
printf("status is %d\n",status);
/*
if ( status != Success )
{
printf("workspace %s does not exist\n", desiredWs);
}
*/
}
else
printf("Never found a match - workspace doesn't exist\n");
/*
XtAppMainLoop (app_context);
*/
}
void ws_change(Widget widget, Atom aWorkspace, XtPointer client_data)
{
printf("In the change workspace callback\n");
}
Here are the errors:
# /scripts > cc switch.c -o switch
(Bundled) cc: "/usr/include/X11/extensions/Print.h", line 250: error 1000: Unexpected symbol: "*".
(Bundled) cc: "/usr/include/X11/extensions/Print.h", line 252: error 1000: Unexpected symbol: "unsigned".
(Bundled) cc: "/usr/include/X11/extensions/Print.h", line 252: error 1616: Unable to open intrinsic file "/usr/local/lib/sysintr".
(Bundled) cc: "/usr/include/X11/extensions/Print.h", line 253: error 1000: Unexpected symbol: "unsigned".
(Bundled) cc: "/usr/include/X11/extensions/Print.h", line 254: error 1000: Unexpected symbol: "client_data".
(Bundled) cc: "/usr/include/X11/extensions/Print.h", line 254: error 1584: Inconsistent type declaration: "XPointer".
(Bundled) cc: "/usr/include/X11/extensions/Print.h", line 254: warning 525: Redeclaration of identifier "XPointer".
(Bundled) cc: "/usr/include/X11/extensions/Print.h", line 256: error 1000: Unexpected symbol: "*".
(Bundled) cc: "/usr/include/X11/extensions/Print.h", line 259: error 1000: Unexpected symbol: ")".
(Bundled) cc: "/usr/include/X11/extensions/Print.h", line 259: error 1616: Unable to open intrinsic file "/usr/local/lib/sysintr".
(Bundled) cc: "/usr/include/X11/extensions/Print.h", line 290: error 1000: Unexpected symbol: "Display".
(Bundled) cc: "/usr/include/X11/extensions/Print.h", line 291: error 1000: Unexpected symbol: "XPContext".
(Bundled) cc: "/usr/include/X11/extensions/Print.h", line 290: error 1573: Type of "display" is undefined due to an illegal declaration.
(Bundled) cc: "/usr/include/X11/extensions/Print.h", line 290: error 1578: Size of struct or union member is unknown.
(Bundled) cc: "/usr/include/X11/extensions/Print.h", line 291: error 1573: Type of "context" is undefined due to an illegal declaration.
(Bundled) cc: "/usr/include/X11/extensions/Print.h", line 291: error 1578: Size of struct or union member is unknown.
(Bundled) cc: "/usr/include/X11/extensions/Print.h", line 302: error 1000: Unexpected symbol: "Display".
(Bundled) cc: "/usr/include/X11/extensions/Print.h", line 303: error 1000: Unexpected symbol: "XPContext".
(Bundled) cc: "/usr/include/X11/extensions/Print.h", line 302: error 1573: Type of "display" is undefined due to an illegal declaration.
(Bundled) cc: "/usr/include/X11/extensions/Print.h", line 302: error 1578: Size of struct or union member is unknown.
(Bundled) cc: "/usr/include/X11/extensions/Print.h", line 303: error 1573: Type of "context" is undefined due to an illegal declaration.
(Bundled) cc: "/usr/include/X11/extensions/Print.h", line 303: error 1578: Size of struct or union member is unknown.
(Bundled) cc: "/usr/include/X11/extensions/Print.h", line 313: error 1000: Unexpected symbol: "Display".
(Bundled) cc: "/usr/include/X11/extensions/Print.h", line 314: error 1000: Unexpected symbol: "XPContext".
(Bundled) cc: "/usr/include/X11/extensions/Print.h", line 313: error 1573: Type of "display" is undefined due to an illegal declaration.
(Bundled) cc: "/usr/include/X11/extensions/Print.h", line 313: error 1578: Size of struct or union member is unknown.
(Bundled) cc: "/usr/include/X11/extensions/Print.h", line 314: error 1573: Type of "context" is undefined due to an illegal declaration.
(Bundled) cc: "/usr/include/X11/extensions/Print.h", line 314: error 1578: Size of struct or union member is unknown.
(Bundled) cc: "/usr/include/X11/extensions/Print.h", line 552: error 1000: Unexpected symbol: "XpCreateContext".
(Bundled) cc: error 2017: Cannot recover from earlier errors, terminating.
Any C people that can help me out?
Thanks,
Rich
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-12-2006 03:02 AM
04-12-2006 03:02 AM
Solutionhave you spotted Alex Glennies answer in http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=1019177
I hope he re-posts it here. Please also read:
http://forums1.itrc.hp.com/service/forums/helptips.do?#28
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-12-2006 03:03 AM
04-12-2006 03:03 AM
Re: Compile switch.c Problem
You can probably try installing HP-UX Develepor's toolkit and try compiling your code again,
http://h20293.www2.hp.com/portal/swdepot/displayProductInfo.do?productNumber=B3394BA
It may help you since it is supported technologies include:
* OSF/Motif 2.1
* X11 R6.2 Xlib
* X11 R6.2 Xt Intrinsics
* X11 R6.2 Athena Widget Set
* Imake
* HP CDE 2.1 (11.00, 11.11 only)
* Audio and imaging multimedia (11.00, 11.11 only)
-Arun
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-12-2006 03:08 AM
04-12-2006 03:08 AM
Re: Compile switch.c Problem
Thanks, I just saw the reply to my other thread. I will also assign the points.
Thanks again,
Rich
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-12-2006 03:10 AM
04-12-2006 03:10 AM
Re: Compile switch.c Problem
Yes, I did install the B3394BA.
Thanks,
Rich
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-12-2006 03:17 AM
04-12-2006 03:17 AM
Re: Compile switch.c Problem
Perhaps, you can try installing Ansi C compiler or aCC to compile this program since you were using bundled CC. Just a thought i should say
-Arun
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-12-2006 04:07 AM
04-12-2006 04:07 AM
Re: Compile switch.c Problem
Thanks, I got a complied version from Alex.
Rich
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-12-2006 04:13 AM
04-12-2006 04:13 AM