LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices



Reply
 
Search this Thread
Old 06-11-2003, 12:35 PM   #1
Castro
LQ Newbie
 
Registered: Apr 2002
Location: Boston, MA
Distribution: Redhat 7.1/7.2
Posts: 5

Rep: Reputation: 0
undefined reference to 'gdbm_open'


Does anyone know why this would compile in one program but not in another?

Have this in my file:
#include <gdbm.h>

One program which has the same identical file compiles fine on the same RedHat 7.3 system. However, I just added it to another program and my new program gives me undefined references for all of the gdbm functions as if the include weren't there?

TIA for any help.

- Marc Castrechini
 
Old 06-11-2003, 04:13 PM   #2
Castro
LQ Newbie
 
Registered: Apr 2002
Location: Boston, MA
Distribution: Redhat 7.1/7.2
Posts: 5

Original Poster
Rep: Reputation: 0
Figured out the problem, if anyone is curious:

My Makefile run by the 'make' command was missing the -lgdbm flag.

I added the following in my configure.in to check for gdbm:

AC_CHECK_LIB(gdbm,gdbm_open,,AC_MSG_ERROR("Required: gdbm database libraries"))
AC_CHECK_HEADER([gdbm.h],,AC_MSG_ERROR("Required: gdbm headers"))

Once that was included, if gdbm is installed properly, it will add that flag where needed after autoconf->configure->automake->make and also make sure the library path is setup as well.

- Castro
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Undefined reference, why? george_mercury Programming 4 05-07-2009 01:15 AM
undefined reference to `XF86VidModeGetModeLine' apokryphos Linux - General 1 08-07-2005 07:40 PM
Undefined Reference ChemicalBurn Programming 2 02-14-2005 04:01 AM
undefined reference mp4-10 Programming 3 01-25-2005 01:38 PM
Yet another 'undefined reference' problem faulpelz2 Linux - Software 3 04-04-2003 12:18 PM


All times are GMT -5. The time now is 02:08 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration