Re: [info-performer] convert n32 to 64-bit

New Message Reply Date view Thread view Subject view Author view

From: Tom Jolley (jolley++at++fltsim.stl.mo.boeing.com)
Date: 07/01/2002 06:23:28


Hi Stephen,

Part of your problem may be that your using the variable match before
it is initialized. All automatic variables, like match, have an unknown
value when defined. Try adding this line before calling XGetVisualInfo():

match.screen = DefaultScreen( dpy );

Stephen Jeffrey wrote:
>
> Hi,
>
> I am trying to convert my code from n32 to 64-bit.
> The -64 and -mips4 compiler options are specified
> but my code behaves incorrectly. Does anyone know
> what other compile options are needed, or do environment
> variables have to be set?
>
> An example of the strange behaviour is the following code:
> ----------------------------------------------------------
> #include <stdlib.h>
> #include <stdio.h>
> #include <GL/glx.h>
> #include <X11/X.h>
>
> int main(int argc, char *argv[])
> {
> int no_found;
> XVisualInfo match, *visualList;
> Display *dpy;
>
> dpy = XOpenDisplay(NULL);
> if ( dpy == NULL ) {
> fprintf(stderr, "Could not open display\n");
> exit(1);
> }
> visualList = XGetVisualInfo(dpy, VisualScreenMask, &match,&no_found);
> fprintf(stderr, "No. of visuals: %d\n", no_found);
>
> return 0;
> }
> ----------------------------------------------------------
> If this is compiled to produce debug info:
>
> CC test.cc -g -64 -o test -lX11
>
> the output is incorrect. If it is compiled without "-g":
>
> CC test.cc -64 -o test -lX11
>
> the output is correct. I can avoid this simply by
> not specifying "-g", but when some performer code
> is added, problems still exist.
>
> any ideas?
>
> cheers
> steve

-- 
Tom Jolley
jolley++at++fltsim.stl.mo.boeing.com


New Message Reply Date view Thread view Subject view Author view

This archive was generated by hypermail 2b29 : Mon Jul 01 2002 - 06:23:36 PDT

This message has been cleansed for anti-spam protection. Replace '++at++' in any mail addresses with the '@' symbol.