mged hates my screen number

  • djgriffith

    djgriffith - 2005-12-07

    I just installed the latest brlcad from source on a new Debian installation of Linux. By all indications the make and install were flawless.

    When I try to run mged I get 'bad screen number "0"'.

    I have tried setting my DISPLAY env. var. to all manner of things, but mged can't connect to the display (even though other X apps have no problem). 

    Compilation of libtk did break initially due to absence of Xlib.h. This was fixed by installation of the X dev tools. However, I see that libtk came with Xlib.h, but a much older version, deeper in the tree at xlib/X11, along with other X-related header files. Could this be an issue ?


    • Sean Morrison

      Sean Morrison - 2005-12-07

      At a glance, my first inclination would be to determine whether you compiled in support for the OpenGL display manager or just the X11 display manager.  They are independent and while the OpenGL one is preferred, the X11 one supports considerably more variable configurations.  You can quickly test this by running mged in console/classic mode:

      mged -c
      BRL-CAD Release 7.6.5   Geometry Editor (MGED)
          Fri Nov 21 17:15:06 EST 2005, Compilation 11

      attach (nu|X|ogl)[nu]? X

      If that pops up a big black window, then OpenGL is the likely culprit.  If it doesn't work, then there's some X11-related issue perhaps bit depth related.

      The old Xlib.h shouldn't be the problem, but the compilation of Tk or the X11/OpenGL display manager might be.  First off, if you're using the OpenGL display manager, I'd disable it by recompiling using the --without-opengl configure flag.  If OpenGL was already disabled (you can determine this by looking at the end of your config.log file in the build directory for the OpenGL summary line:

      sean$ grep "OpenGL support" config.log
      configure:45087: result: OpenGL support .......................: yes

      If it says 'yes', you should recompile.  If it says 'no' already then I'd gather there's some sort of Tk incompatibility. 

      The error "bad screen number" implies that the screen number 0 is greater or less than the number of available/compatible X11 screens as determined by Tk -- which effectively means Tk found 0 compatible X11 screens.  This could be due to the OpenGL canvas, or via wierd run-time conflicts of multiple Tk libraries.  At least that's what initially comes to mind.


      • djgriffith

        djgriffith - 2005-12-07

        Thanks Sean, that was the solution.
        Best regards,


Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.

No, thanks