From owner-freebsd-questions Fri Dec 18 09:52:15 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id JAA05455 for freebsd-questions-outgoing; Fri, 18 Dec 1998 09:52:15 -0800 (PST) (envelope-from owner-freebsd-questions@FreeBSD.ORG) Received: from quackerjack.cc.vt.edu (quackerjack.cc.vt.edu [198.82.160.250]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id JAA05449 for ; Fri, 18 Dec 1998 09:52:12 -0800 (PST) (envelope-from jobaldwi@vt.edu) Received: from sable.cc.vt.edu (sable.cc.vt.edu [128.173.16.30]) by quackerjack.cc.vt.edu (8.8.8/8.8.8) with ESMTP id LAA21401 for ; Fri, 18 Dec 1998 11:48:03 -0500 (EST) Received: from john.baldwinfamily.org (jobaldwi.campus.vt.edu [198.82.67.63]) by sable.cc.vt.edu (8.8.8/8.8.8) with ESMTP id LAA16211 for ; Fri, 18 Dec 1998 11:48:03 -0500 (EST) Message-ID: X-Mailer: XFMail 1.3 [p0] on FreeBSD X-Priority: 3 (Normal) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 8bit MIME-Version: 1.0 Date: Fri, 18 Dec 1998 11:48:03 -0500 (EST) Reply-To: jobaldwi@vt.edu Organization: Virginia Tech From: John Baldwin To: freebsd-questions@FreeBSD.ORG Subject: extern data.... Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG -----BEGIN PGP SIGNED MESSAGE----- Last time I sent a C-related question to -chat and I was told to send it to - -questions, so I hope this is the right list. I have a static array of structs declated in module dblist.o as so: static fieldInfo DB_TYPES[DB_NUMTYPES]={ blah , blah , blah }; I have an extern statement in dblist.h as follows: extern fieldInfo DB_TYPES[DB_NUMTYPES]; I can use data fields from DB_TYPES[] fine in the dbtypes.o module. In another module (dblist.o) I look up some fields from DB_TYPES[]. dblist.o includes dbtypes.h and it compiles fine without any errors. However, when I try to link both of these modules together with other assorted modules gcc tells me: dblist.o: Undefined symbol `_DB_TYPES' referenced from text segment Do I need to use static in the extern declaration or something? Any help appreciated. - --- John Baldwin -- http://members.freedomnet.com/~jbaldwin/ PGP Key: http://members.freedomnet.com/~jbaldwin/pgpkey.asc I get mail, therefore I exist. -----BEGIN PGP SIGNATURE----- Version: 2.6.2 iQB1AwUBNnqHPIjYza302vYpAQGVAAMArdIDhIUsKp0jJEqnp5+bc+Z3mKSTXz0W wpsg3P1PX6KPZiYK08EtLGCih0ekfSwvZyYgagHSMNQInREqkVpsv6C/HF+GS2nI Ha9r0VdpcpLGjZBpgdEIfspLUt4JlMtk =8Dou -----END PGP SIGNATURE----- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message