From: Felix Morley Finch <felix@crowfix.com>
To: pgsql-interfaces@postgresql.org
Subject: C++ linking problems (newbie mode)
Date: 24 May 1998 20:55:06 -0000
Message-ID: <19980524205506.22284.qmail@crowfix.com> (raw)
I've been teaching myself SQL for the last year or so, using
Postgres. One of my first projects was putting my CDs into a
database. I've written the access program in Perl (both standalone
and CGI-BIN), Java, and C (with Gtk). I figured I woudl give it a
whack in C++ too. Quite a learning experience! My first experience
with Gtk was the C program, so I'm basically learning 3 things at once
(Gtk, C++, libpq++).
And I'm getting a bunch of link errors. Here's my Makefile:
ccds: ccds.cc
g++ -O -Wall -I/usr/local/pgsql/include -I/usr/local/lib/glib/include -I/usr/local/include -I/usr/X11R6/include -L/usr/local/pgsql/lib -lpq++ -lpq -lcrypt -L/usr/local/lib -L/usr/X11R6/lib -lgtk -lgdk -lglib -lXext -lX11 -lm -lgtkmm ccds.cc -o ccds
Gosh that's a mouthful :-)
And here's some of the result:
/tmp/cca222721.o: In function `cds_editRow::changeCallback(int)':
/tmp/cca222721.o(.text+0x75d): undefined reference to `PgConnection::ExecTuplesOk(char const *)'
/tmp/cca222721.o(.text+0xa06): undefined reference to `PgConnection::ExecCommandOk(char const *)'
/tmp/cca222721.o(.text+0x35a9): undefined reference to `PgConnection::PgConnection(char const *)'
/tmp/cca222721.o(.text+0x35df): undefined reference to `PgConnection::Status(void)'
/tmp/cca222721.o(.gnu.linkonce.t._._10PgDatabase+0x13): undefined reference to `PgConnection::~PgConnection(void)'
/tmp/cca222721.o: In function `PgDatabase type_info function':
/tmp/cca222721.o(.gnu.linkonce.t.__tf10PgDatabase+0xd): undefined reference to `PgConnection type_info function'
/tmp/cca222721.o(.gnu.linkonce.t.__tf10PgDatabase+0x12): undefined reference to `PgConnection type_info node'
collect2: ld returned 1 exit status
make: *** [ccds] Error 1
I tried supplying my own minimal PgDatabase class; the link succeeds,
the program runs, but it's not very useful...
This must be pretty basic, so if someone wants to just send email and
not clutter the list, that's fine with me.
--
... _._. ._ ._. . _._. ._. ___ .__ ._. . .__. ._ .. ._.
Felix Finch: scarecrow repairman & rocket surgeon / felix@crowfix.com
PGP = 91 B3 94 7C E9 E8 76 2D E1 63 51 AA A0 48 89 2F ITAR license #4933
I've found a solution to Fermat's Last Theorem but I see I've run out of room o
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-interfaces@postgresql.org
Cc: felix@crowfix.com
Subject: Re: C++ linking problems (newbie mode)
In-Reply-To: <19980524205506.22284.qmail@crowfix.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox