UbuntuGDBM Problems and Solutions

Source: Internet
Author: User
Problem description: When writing ndbm interface functions, the corresponding header file cannot be found. You can use the ls command to view the header file./usr/include does not have the header file you want, whether it is # include & lt; ndbm. h & gt; or # include & lt; gdbm-ndbm.h & gt;, cannot be found. Solution: Install gdbm because there is no header file about dbm in/usr/include, so there is no installation reason: run the following command to install sudoapt-

Problem description: When writing the ndbm interface function, the corresponding header file cannot be found. You can run the ls command to check the header file./usr/include does not display the header file, whether it is # include Or # include , Cannot be found.

Solution: Install gdbm because there is no header file about dbm in/usr/include, so there is no installation reason:

Run the following command to install the SDK:

Sudo apt-get install libgdbm-dev

After that, the corresponding header file appears in the/usr/include file. Compile again to make it successful.

Use the header file # include in the source file

By default, the gdbm database is installed in Ubuntu. You should use gdbm to access the database. If you still need to access the database in dbm mode if ndbm, you need to use the gdbm-ndbm.h header file, the-lgdbm_compat link option should be used to compile the link

Example: gcc-o dbm1-I/usr/include/gdbm dbm1.c-lgdbm_compat-lgdbm

For more information about Ubuntu, see Ubuntu special page http://www.linuxidc.com/topicnews.aspx? Tid = 2

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.