C++ linking problems (newbie mode) - Mailing list pgsql-interfaces

From Felix Morley Finch
Subject C++ linking problems (newbie mode)
Date
Msg-id 19980524205506.22284.qmail@crowfix.com
Whole thread Raw
List pgsql-interfaces
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

pgsql-interfaces by date:

Previous
From: "Bob Taylor."
Date:
Subject: subscribe
Next
From: Christopher Luk
Date:
Subject: Increase buffer?