HOME  NEWS  FORUM  DOWNLOAD  LINK
OpenCOBOL - an open-source COBOL compiler
Main Menu
Download
Documentation
Development
Who's Online
25 user(s) are online (5 user(s) are browsing Forum)

Members: 0
Guests: 25

more...
Powered by
SourceForge

Xoops

Creative Commons

OpenCOBOL Forum Index
   OpenCOBOL
     DB2 Express-C using Windows 7
Register To Post

Flat Previous Topic | Next Topic
Poster Thread
btiffin
Posted on: 2012/2/4 17:37
Home away from home
Joined: 2008/6/7
From: CANADA
Posts: 1196
DB2 Express-C using Windows 7
from iainw on forum.peoplecards.ca, with one edit to put in code blocks


Hello,

I'm having problem with a program compiling an OpenCOBOL 1.1 program which uses DB2 Express-C in a Windows 7 environment. Following the advice on the forum I have updated libcob.h, adding:
#ifdef DB2SQL
#include <sqlaprep.h>
#endif

Have the following system variables:
COB_LIBRARY_PATH = C:\OC\pgms
COBCPY = C:\OC\pgms
INCLUDE = C:\PROGRA~2\IBM\SQLLIB\INCLUDE;C:\PROGRA~2\IBM\SQLLIB\LIB
LIB = ;C:\PROGRA~2\IBM\SQLLIB\LIB
LINK = C:\Cobol\lib\db2api.lib
PATH is set up to included all required OC and DB2 programs etc.

Using the DB2 Express-C line command processor (DOS window), connected to the sample database and precomiled the program:
(1) connect to sample
(2) prep C:\OC\pgms\db2test2.sqb bindfile using C:\OC\pgms\db2test2.bnd target ANSI_COBOL

In Cgywin tried to compile the program, commans used = cobc -v -x -I C:\PROGRA~2\IBM\SQLLIB\lib -fixed -fstatic -D DB2SQL db2test2.cbl
Get the following:
preprocessing db2test2.cbl into /tmp/cob3872_0.cob
translating /tmp/cob3872_0.cob into /tmp/cob3872_0.c
gcc-4 -pipe -c -I/usr/local/include   -Wno-unused -fsigned-char -Wno-pointer-sig
n -IC:PROGRA~2IBMSQLLIBlib -DDB2SQL  -o /tmp/cob3872_0.o /tmp/cob3872_0.c
gcc-4 -pipe  -Wl,--export-all-symbols -Wl,--enable-auto-import -o db2test2 /tmp/
cob3872_0.o  -L/usr/local/lib -lcob -lm -lgmp -lintl -lncurses -ldb
/tmp/cob3872_0.o:cob3872_0.c:(.text+0xaaf): undefined reference to `_sqlgstrt'
/tmp/cob3872_0.o:cob3872_0.c:(.text+0xb84): undefined reference to `_sqlgaloc'
/tmp/cob3872_0.o:cob3872_0.c:(.text+0xcbf): undefined reference to `_sqlgstlv'
/tmp/cob3872_0.o:cob3872_0.c:(.text+0xdbb): undefined reference to `_sqlgcall'
/tmp/cob3872_0.o:cob3872_0.c:(.text+0xe1b): undefined reference to `_sqlgstop'
/tmp/cob3872_0.o:cob3872_0.c:(.text+0x11fe): undefined reference to `_sqlgstrt'
/tmp/cob3872_0.o:cob3872_0.c:(.text+0x12fa): undefined reference to `_sqlgcall'
/tmp/cob3872_0.o:cob3872_0.c:(.text+0x135a): undefined reference to `_sqlgstop'
/tmp/cob3872_0.o:cob3872_0.c:(.text+0x147f): undefined reference to `_sqlgstrt'
/tmp/cob3872_0.o:cob3872_0.c:(.text+0x1554): undefined reference to `_sqlgaloc'
/tmp/cob3872_0.o:cob3872_0.c:(.text+0x169b): undefined reference to `_sqlgstlv'
/tmp/cob3872_0.o:cob3872_0.c:(.text+0x17e2): undefined reference to `_sqlgstlv'
/tmp/cob3872_0.o:cob3872_0.c:(.text+0x1929): undefined reference to `_sqlgstlv'
/tmp/cob3872_0.o:cob3872_0.c:(.text+0x1a70): undefined reference to `_sqlgstlv'
/tmp/cob3872_0.o:cob3872_0.c:(.text+0x1bb7): undefined reference to `_sqlgstlv'
/tmp/cob3872_0.o:cob3872_0.c:(.text+0x1cfe): more undefined references to `_sqlg
stlv' follow
/tmp/cob3872_0.o:cob3872_0.c:(.text+0x1f41): undefined reference to `_sqlgcall'
/tmp/cob3872_0.o:cob3872_0.c:(.text+0x1fa1): undefined reference to `_sqlgstop'
/tmp/cob3872_0.o:cob3872_0.c:(.text+0x22fb): undefined reference to `_sqlgstrt'
/tmp/cob3872_0.o:cob3872_0.c:(.text+0x23f7): undefined reference to `_sqlgcall'
/tmp/cob3872_0.o:cob3872_0.c:(.text+0x2457): undefined reference to `_sqlgstop'
/tmp/cob3872_0.o:cob3872_0.c:(.text+0x25cf): undefined reference to `_sqlgstrt'
/tmp/cob3872_0.o:cob3872_0.c:(.text+0x26cb): undefined reference to `_sqlgcall'
/tmp/cob3872_0.o:cob3872_0.c:(.text+0x272b): undefined reference to `_sqlgstop'
collect2: ld returned 1 exit status

Can anyone suggest what I need to do to get a clean compile please?

Regards,
iain
Flat Previous Topic | Next Topic

Subject Poster Date
 » DB2 Express-C using Windows 7 btiffin 2012/2/4 17:37
     Re: DB2 Express-C using Windows 7 human 2012/2/5 21:04
       Re: DB2 Express-C using Windows 7 btiffin 2012/2/29 6:52
         Re: DB2 Express-C using Windows 7 Franklin 2012/2/29 9:03
           Re: DB2 Express-C using Windows 7 human 2012/2/29 11:16
             Re: DB2 Express-C using Windows 7 btiffin 2012/3/2 10:11

Register To Post
 
Copyright (C) 2005 The OpenCOBOL Project. All rights reserved.
Powered by Xoops2 | PHP | MySQL | Apache
ocean-net