Subject: Problem_compiling_Postgres_with_Interviews

From: [email-masked] (JAZBUTIS,GINTAUTAS BRONIUS)
Date: Sat, 9 May 92 12:26:51 -0700

I have run the testlibpq.c program, loading library -lpq, and it works fine: 

cc -c -I/home/pd/postgres/src/lib/H testlibpq.c
cc -o testlibpq testlibpq.o -L/home/pd/postgres/obj.sparc -lpq

The output is as expected.

Now, we are trying to run it as part of an INTERVIEWS application; `ivdbtest-main.c'
contains the source code (also have MonoScene stuff, INTERVIEWS files), 
and we are running the CC compiler.  This is the result:

CC +p -L/home/pd/postgres/obj.sparc   -o ivdbtest.exe _MonoScene_5.o  _MonoScene_5-core.o  ivdbtest-main.o -lpq -L/usr/local/interviews/lib/SUN4 -lUnidraw  -lIV  -lXext -lX11 -lm  
ld: Undefined symbol 
   PQngroups(PortalBuffer*)     
   PQfinish()    
   PQgetvalue(PortalBuffer*,int,int) 
   PQexec(char*) 
   PQparray(char*) 
   PQsetdb(char*) 
Compilation failed
***Error code 2
make: Fatal error: command failed for target `ivdbtest.exe'

I can't determine the source of the problem.

Is this something to do with our makefile (icluded at end of the
message)?  The CC compiler?

Any help would be greatly appreciated.

Thanks in advance.

                              Gintas Jazbutis

                              [email-masked]

*****   The following is our makefile:   ***********************************

# Makefile generated by imake - do not edit!
# $XConsortium: imake.c,v 1.65 91/07/25 17:50:17 rws Exp $
#
# The cpp used on this machine replaces all newlines and multiple tabs and
# spaces in a macro expansion with a single space.  Imake tries to compensate
# for this, but is not always successful.
#

# Read "InterViews/template" to understand how this Makefile was generated.
# Edit <InterViews/arch.def> to add support for a new platform.
# Edit <InterViews/iv-sun.cf> to change platform-specific parameters.
# Edit <InterViews/local.def> to change site-specific parameters.
# Edit <./dbtest/ivdbtest-imake> to change actions that make should perform.

# architecture:  SUN4

# platform:  $XConsortium: sun.cf,v 1.69 91/09/09 18:23:59 rws Exp $

# operating system:  SunOS 4.1.1

# $XConsortium: sunLib.rules,v 1.6 91/03/24 17:55:58 rws Exp $

              SHELL = /bin/sh

              IMAKE = imake
         IMAKEFLAGS = \
 -T "InterViews/template"\
 -I$(CONFIGDIR) -I$(XCONFIGDIR)\
 $(SPECIAL_IMAKEFLAGS)
 SPECIAL_IMAKEFLAGS =   -DUseInstalled
             DEPEND = makedepend
     DEPEND_CCFLAGS = $(CCDEFINES) $(CCINCLUDES) -I/usr/include/CC
               MAKE = make
           PASSARCH = ARCH="$(ARCH)" SPECIAL_IMAKEFLAGS="$(SPECIAL_IMAKEFLAGS)"
          ARCHORCPU = $$CPU
               ARCH = $(ARCHORCPU)$(SPECIAL_ARCH)
       SPECIAL_ARCH =

           CCDRIVER = CC +p
           CCSUFFIX = c
                SRC = .
              SLASH = /
               SRCS = $(SRC)$(SLASH)*.$(CCSUFFIX)
               OBJS = *.o
               AOUT = a.out

            CCFLAGS = $(APP_CCFLAGS) $(IV_CCFLAGS) $(EXTRA_CCFLAGS)
         IV_CCFLAGS = \
 \
 \
 $(SHARED_CCFLAGS)\
 $(CCDEFINES)\
 $(CCINCLUDES)
      DEBUG_CCFLAGS = -g
   OPTIMIZE_CCFLAGS = -O
     SHARED_CCFLAGS =
      EXTRA_CCFLAGS = -pipe

          CCDEFINES = $(APP_CCDEFINES) $(IV_CCDEFINES) $(EXTRA_CCDEFINES)
       IV_CCDEFINES = $(LANGUAGE_CCDEFINES) $(BACKWARD_CCDEFINES)
 LANGUAGE_CCDEFINES = -Dcplusplus_2_1
 BACKWARD_CCDEFINES =
    EXTRA_CCDEFINES =

         CCINCLUDES = $(APP_CCINCLUDES) $(IV_CCINCLUDES) $(EXTRA_CCINCLUDES)
     APP_CCINCLUDES = -I/home/pd/postgres/src/lib/H
      IV_CCINCLUDES = \
 $(BACKWARD_CCINCLUDES)\
 $(TOP_CCINCLUDES)\
 $(X_CCINCLUDES)
BACKWARD_CCINCLUDES =
     TOP_CCINCLUDES = -I$(INCDIR)
       X_CCINCLUDES =
   EXTRA_CCINCLUDES =

          CCLDFLAGS = $(APP_CCLDFLAGS) $(IV_CCLDFLAGS) $(EXTRA_CCLDFLAGS)
      APP_CCLDFLAGS = -L/home/pd/postgres/obj.sparc
       IV_CCLDFLAGS = \
 \
 \
 $(NONSHARED_CCLDFLAGS)
NONSHARED_CCLDFLAGS =
    EXTRA_CCLDFLAGS =

          CCDEPLIBS = $(APP_CCDEPLIBS) $(IV_CCDEPLIBS) $(EXTRA_CCDEPLIBS)
       IV_CCDEPLIBS = \
 $(DEPLIBUNIDRAW)\
 $(DEPLIBGRAPHIC)\
 $(DEPLIBIV)\
 $(DEPLIBXEXT)\
 $(DEPLIBX11)\
 $(DEPLIBM)
    EXTRA_CCDEPLIBS =

           CCLDLIBS = $(APP_CCLDLIBS) $(IV_CCLDLIBS) $(EXTRA_CCLDLIBS)
       APP_CCLDLIBS = -lpq
        IV_CCLDLIBS = \
 $(LIBDIRPATH)\
 $(LDLIBUNIDRAW)\
 $(LDLIBGRAPHIC)\
 $(LDLIBIV)\
 $(XLIBDIRPATH)\
 $(LDLIBXEXT)\
 $(LDLIBX11)\
 $(LDLIBM)\
 $(ABSLIBDIRPATH)
     EXTRA_CCLDLIBS =

            INSTALL = install
       INSTPGMFLAGS = -s
       INSTBINFLAGS = -m 0755
       INSTUIDFLAGS = -m 4755
       INSTLIBFLAGS = -m 0644
       INSTINCFLAGS = -m 0444
       INSTMANFLAGS = -m 0444
       INSTDATFLAGS = -m 0444
      INSTKMEMFLAGS = -m 4755

                 AR = ar cq
                 AS = as
                 CP = cp
                CPP = /lib/cpp $(EXTRA_CCDEFINES)
      PREPROCESSCMD = $(CCDRIVER) -E $(EXTRA_CCDEFINES)
                 LD = ld
                 LN = ln -s
          MKDIRHIER = mkdirhier
                 MV = mv
             RANLIB = ranlib
    RANLIBINSTFLAGS =
                 RM = rm -f
             RM_CMD = $(RM) ,* .emacs_* *..c *.BAK *.CKP *.a *.bak *.ln *.o a.out core errs make.log make.out tags TAGS
              TROFF = psroff

                TOP = .
        CURRENT_DIR = .

             BINDIR = /usr/local/interviews/bin/$(ARCH)
          CONFIGDIR = /usr/local/interviews/config
             INCDIR = /usr/local/interviews/include
             LIBDIR = /usr/local/interviews/lib/$(ARCH)
          LIBALLDIR = /usr/local/interviews/lib/all
             MANDIR = /usr/local/interviews/man

       ABSCONFIGDIR = /usr/local/interviews/config
          ABSLIBDIR = /usr/local/interviews/lib/$(ARCH)
       ABSLIBALLDIR = /usr/local/interviews/lib/all
         XCONFIGDIR = /usr/lib/X11/config
            XINCDIR = /usr/include
            XLIBDIR = /usr/lib
          PSFONTDIR = /usr/lib/ps

all::

Makefile::
	-@if [ -f Makefile ]; then \
	$(RM) Makefile.bak; \
	$(MV) Makefile Makefile.bak; \
	else exit 0; fi
	$(IMAKE) $(IMAKEFLAGS) -DTOPDIR=$(TOP) -DCURDIR=$(CURRENT_DIR)
Makefiles::
depend::
install::

clean::
	@$(RM_CMD) "#"*

# -------------------------------------------------------------------------

# DO NOT EDIT -- generated by ibmkmf

SPECIAL_IMAKEFLAGS = \
    -f ivdbtest-imake -s ivdbtest-make -DUseInstalled -DTurnOptimizingOn=0

SRCS = \
    _MonoScene_5.$(CCSUFFIX) \
    _MonoScene_5-core.$(CCSUFFIX) \
    ivdbtest-main.$(CCSUFFIX)
OBJS = \
    _MonoScene_5.o \
    _MonoScene_5-core.o \
    ivdbtest-main.o
AOUT = ivdbtest.exe

 DEPLIBUNIDRAW =
 DEPLIBIV =
 DEPLIBXEXT =
 DEPLIBX11 =
 DEPLIBM =

 LIBDIRPATH = -L$(LIBDIR)
 LDLIBUNIDRAW = -lUnidraw
 LDLIBIV = -lIV
 XLIBDIRPATH =
 LDLIBXEXT = -lXext
 LDLIBX11 = -lX11
 LDLIBM = -lm
 ABSLIBDIRPATH =

 BACKWARD_CCDEFINES = -Div2_6_compatible
BACKWARD_CCINCLUDES = -I$(INCDIR)/InterViews/2.6 -I$(INCDIR)/IV-look/2.6

PROGRAM = ivdbtest

all:: $(AOUT)

$(AOUT):  $(CCDEPLIBS)
	-@if [ ! -w $@ ]; then $(RM) $@; else exit 0; fi
	$(CCDRIVER) $(CCLDFLAGS) -o $@ $(OBJS) $(CCLDLIBS)

install:: $(AOUT)
	-@if [ -d $(BINDIR) ]; then exit 0; \
	else (set -x; $(MKDIRHIER) $(BINDIR)); fi
	$(INSTALL) -c $(INSTPGMFLAGS) $(INSTBINFLAGS) $(AOUT) $(BINDIR)/$(PROGRAM)
	$(RM) $(AOUT)

depend::
	$(DEPEND) -s "# DO NOT DELETE" -- $(DEPEND_CCFLAGS) -- $(SRCS)

$(AOUT): ivdbtest-main.o
ivdbtest-main.o: ivdbtest-main.$(CCSUFFIX)
	@$(RM) ivdbtest-main.o ivdbtest-main..c
	$(CCDRIVER) $(CCFLAGS)  -c ivdbtest-main.$(CCSUFFIX)

$(AOUT): _MonoScene_5.o
_MonoScene_5.o: _MonoScene_5.$(CCSUFFIX)
	@$(RM) _MonoScene_5.o _MonoScene_5..c
	$(CCDRIVER) $(CCFLAGS)  -c _MonoScene_5.$(CCSUFFIX)

$(AOUT): _MonoScene_5-core.o
_MonoScene_5-core.o: _MonoScene_5-core.$(CCSUFFIX)
	@$(RM) _MonoScene_5-core.o _MonoScene_5-core..c
	$(CCDRIVER) $(CCFLAGS)  -c _MonoScene_5-core.$(CCSUFFIX)

# DO NOT DELETE

bunch of paths for INTERVIEWS applications...