Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-10293

'setupterm' was not declared in this scope

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Fixed
    • 10.1.14
    • 5.5.54, 10.0.29, 10.1.20
    • Compiling
    • None
    • Linux Mint 18 BETA
      gcc 5.3.1-14ubuntu2.1
      libncurses5

    Description

      During compile, make gives:

      /opt/mariadb-10.1.14/client/mysql.cc:4911:51: error: 'setupterm' was not declared in this scope
             have_curses= setupterm((char *)0, 1, &errret) != ERR;
      

      Attachments

        Activity

          unruffled eli bird added a comment -

          Just finished compiling 10.1.9 and this error is not present in that version.

          unruffled eli bird added a comment - Just finished compiling 10.1.9 and this error is not present in that version.
          danblack Daniel Black added a comment -

          Does this occur with libncurses5-dev installed? If so which version of this library is in MINT?

          danblack Daniel Black added a comment - Does this occur with libncurses5-dev installed? If so which version of this library is in MINT?
          unruffled eli bird added a comment -

          running: "locate libncurses" shows that I have

          /lib/x86_64-linux-gnu/libncurses.so.5.9

          and also

          /usr/lib/x86_64-linux-gnu/libncurses.so

          I think the answer you're looking for is 5.9

          unruffled eli bird added a comment - running: "locate libncurses" shows that I have /lib/x86_64-linux-gnu/libncurses.so.5.9 and also /usr/lib/x86_64-linux-gnu/libncurses.so I think the answer you're looking for is 5.9

          I'm occasionally hitting this on my laptop, re-running cmake and make fixes it so I guess it is a build order issue?

          LinuxJedi Andrew Hutchings (Inactive) added a comment - I'm occasionally hitting this on my laptop, re-running cmake and make fixes it so I guess it is a build order issue?
          pwajda Piotr Wajda added a comment -

          I'm having the same problem. Re-running cmake and make doesn't help.
          On Mint 18 libncurses5-dev are in 6.0 version even if 'locate libncurses' says different:
          ja@rio ~/dev/mariadbserver $ dpkg -l | grep libncurses5-dev
          ii libncurses5-dev:amd64 6.0+20160213-1ubuntu1 amd64
          ja@rio ~/dev/mariadbserver $ locate libncurses.so
          /lib/i386-linux-gnu/libncurses.so.5
          /lib/i386-linux-gnu/libncurses.so.5.9
          /lib/x86_64-linux-gnu/libncurses.so.5
          /lib/x86_64-linux-gnu/libncurses.so.5.9

          pwajda Piotr Wajda added a comment - I'm having the same problem. Re-running cmake and make doesn't help. On Mint 18 libncurses5-dev are in 6.0 version even if 'locate libncurses' says different: ja@rio ~/dev/mariadbserver $ dpkg -l | grep libncurses5-dev ii libncurses5-dev:amd64 6.0+20160213-1ubuntu1 amd64 ja@rio ~/dev/mariadbserver $ locate libncurses.so /lib/i386-linux-gnu/libncurses.so.5 /lib/i386-linux-gnu/libncurses.so.5.9 /lib/x86_64-linux-gnu/libncurses.so.5 /lib/x86_64-linux-gnu/libncurses.so.5.9

          I had the same on my fresh xenial and re-cmake / re-make didn't help.
          It looks the error occurs when HAVE_TERM_H is not defined, but HAVE_SETUPTERM is defined.
          For me it is gone for me after I changed following lines in mysql.cc :

          #if defined(HAVE_CURSES_H) && defined(HAVE_TERM_H)
          #include <curses.h>
          #include <term.h>

          to:
          #if defined(HAVE_CURSES_H)
          #include <curses.h>
          #include <term.h>

          (The correct fix may be different)

          anikitin Andrii Nikitin (Inactive) added a comment - I had the same on my fresh xenial and re-cmake / re-make didn't help. It looks the error occurs when HAVE_TERM_H is not defined, but HAVE_SETUPTERM is defined. For me it is gone for me after I changed following lines in mysql.cc : #if defined(HAVE_CURSES_H) && defined(HAVE_TERM_H) #include <curses.h> #include <term.h> to: #if defined(HAVE_CURSES_H) #include <curses.h> #include <term.h> (The correct fix may be different)

          Thanks anikitin, that helped to pin it down.

          It is a user mistake, strictly speaking. To repeat this error one need to start without libncurses5-dev installed. Run cmake. It will fail with the message

          Curses library not found. Please install appropriate package, remove CMakeCache.txt and rerun cmake.
          On Debian/Ubuntu, package name is libncurses5-dev, on Redhat and derivates it is ncurses-devel.
          

          Now, install the appropriate package, ignore the help text and DO NOT remove CMakeCache.txt, and re-run cmake. This way you will end up with part of the configuration being done without curses and the other part — with curses. CMakeCache.txt will be inconsistent and the compilation will fail.

          Remember that CMake works incrementally, it does not re-run checks that were already run and stored in the CMakeCache.txt.


          Having said that, I seem to have fixed this particular issue. Still, in the future, if you change you system configuration, it's always safer to remove CMakeCache.txt file before re-running cmake.

          serg Sergei Golubchik added a comment - Thanks anikitin , that helped to pin it down. It is a user mistake, strictly speaking. To repeat this error one need to start without libncurses5-dev installed. Run cmake . It will fail with the message Curses library not found. Please install appropriate package, remove CMakeCache.txt and rerun cmake. On Debian/Ubuntu, package name is libncurses5-dev, on Redhat and derivates it is ncurses-devel. Now, install the appropriate package, ignore the help text and DO NOT remove CMakeCache.txt , and re-run cmake . This way you will end up with part of the configuration being done without curses and the other part — with curses. CMakeCache.txt will be inconsistent and the compilation will fail. Remember that CMake works incrementally, it does not re-run checks that were already run and stored in the CMakeCache.txt . Having said that, I seem to have fixed this particular issue. Still, in the future, if you change you system configuration, it's always safer to remove CMakeCache.txt file before re-running cmake .

          People

            serg Sergei Golubchik
            unruffled eli bird
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Git Integration

                Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.