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