Some problems encountered in Linux dbm

Source: Internet
Author: User

Problem 1: gcc compilation always undefined reference to 'dbm _ open'

Description:

Gcc-I/user/include-L/user/lib-o dbm1 dbm1.c-lgdbm

This statement always fails. I installed dbm once through the deb package, and its files were included in/usr/include and/user/lib, respectively. An error occurred while compiling. So I tried to download the source file myself, compile it myself, http://Ubuntu.cn99.com/ubuntu/pool/main/g/gdbm/

The compiled files are in/user/local/include and/user/local/lib respectively. If I include the files and compile them, an error occurs. Realize that the problem is not in the file.

The real problem is that if gdbm is used, it must be compatible with dbm or ndmb, and gdbm_compat should be connected during compilation. Using the following command, I passed.

Gcc-I/user/include-L/user/lib-o dbm1 dbm1.c-lgdbm-lgdbm_compat

If you compile the file by yourself, first./configure, then make install, and then make install-compat (this is the extension installed ). Read the README files in the downloaded package.

Problem 2: ndbm. h not found

Specific description: After gdbm is installed using the deb package, the required ndbm. h header file cannot be found. But you will find a file named gdbm-ndbm.h, you just need to change the file name to ndbm. h, of course, you need some permissions.

Sudo cp '/usr/include/gdbm-ndbm.h ''/usr/include/ndbm. H'

In this case, OK.

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.