If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > where is db2gcc.bat?

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 02-22-06, 10:44
lehare lehare is offline
Registered User
 
Join Date: Feb 2006
Posts: 13
where is db2gcc.bat?

Hi guys,

where exectly can one find this file?

i've installed DB2 Enterprise Edition 8.1 fixpac 6 - does this file come with the server software [which then means my installation is buggered?]

thanx for any help
Reply With Quote
  #2 (permalink)  
Old 02-22-06, 10:58
Marcus_A Marcus_A is offline
Registered User
 
Join Date: May 2003
Location: USA
Posts: 5,196
__________________
M. A. Feldman
IBM Certified DBA on DB2 for Linux, UNIX, and Windows
IBM Certified DBA on DB2 for z/OS and OS/390
Reply With Quote
  #3 (permalink)  
Old 02-23-06, 07:49
lehare lehare is offline
Registered User
 
Join Date: Feb 2006
Posts: 13
I have menaged to install the cygwin product but the command : gcc --version fails saying the file gcc is unknown

below is the set of packages that i installed - what is missing cause i've folowed the install instructions to the letter - even though i installed newer versions...

855 base-passwd-2.2-1.tar.bz2
514,165 bash-3.0-14.tar.bz2
12,307,814 binutils-20050610-1-src.tar.bz2
4,619,594 binutils-20050610-1.tar.bz2
46 clear-1.0-2.tar.bz2
1,404,680 cygwin-1.5.19-4.tar.bz2
46 gcc-3.4.4-1.tar.bz2
13,323,520 gcc-core-3.4.4-1-src.tar.bz2
3,709,052 gcc-core-3.4.4-1.tar.bz2
2,481,063 gcc-g++-3.4.4-1-src.tar.bz2
3,031,670 gcc-g++-3.4.4-1.tar.bz2
46 gcc-mingw-20040810-1-src.tar.bz2
46 gcc-mingw-20040810-1.tar.bz2
3,565,298 gcc-mingw-core-20050522-1-src.tar.bz2
70,447 gcc-mingw-core-20050522-1.tar.bz2
4,737,631 gcc-mingw-g++-20050522-1-src.tar.bz2
1,938,737 gcc-mingw-g++-20050522-1.tar.bz2
686,115 libiconv2-1.9.2-2.tar.bz2
19,495 libintl2-0.12.1-3.tar.bz2
16,273 libintl3-0.14.5-1.tar.bz2
169,516 libncurses8-5.4-4.tar.bz2
80,862 libreadline6-5.1-4.tar.bz2
249,826 mingw-runtime-3.9-2-src.tar.bz2
218,894 mingw-runtime-3.9-2.tar.bz2
349,256 ncurses-5.4-4.tar.bz2
194,430 terminfo-5.4_20041009-1.tar.bz2
695,242 texinfo-4.8-1.tar.bz2
1,153,271 w32api-3.6-1.tar.bz2
381 _update-info-dir-00373-1.tar.bz2

thanx for any help
Reply With Quote
  #4 (permalink)  
Old 02-25-06, 12:35
Peter.Vanroose Peter.Vanroose is offline
Registered User
 
Join Date: Sep 2004
Location: Belgium
Posts: 1,079
Maybe you just need to update the PATH variable: have a look at
Control Panel --> System --> Advanced --> Environment Variables --> Variable "Path" --> add ";%SystemRoot%\cygwin\bin" to the value
(or whatever is the location of gcc.exe)
__________________
--_Peter Vanroose,
__IBM Certified Database Administrator, DB2 9 for z/OS
__IBM Certified Application Developer
__ABIS Training and Consulting
__http://www.abis.be/
Reply With Quote
  #5 (permalink)  
Old 02-27-06, 05:42
lehare lehare is offline
Registered User
 
Join Date: Feb 2006
Posts: 13
i did a search for gcc.exe and there is none on my machine ... i installed this product in c:\cygwin\

i thought the whole point of this product was especially for gcc.exe ... thus meaning its supposed to install by default... i'm i wrong?
Reply With Quote
  #6 (permalink)  
Old 02-27-06, 18:26
Peter.Vanroose Peter.Vanroose is offline
Registered User
 
Join Date: Sep 2004
Location: Belgium
Posts: 1,079
Quote:
Originally Posted by lehare
i thought the whole point of this product was especially for gcc.exe ... thus meaning its supposed to install by default... i'm i wrong?
Not really -- cygwin is meant to provide a UNIX-linke environment on MS-Windows.
Few people need the "development" part of the Cygwin kit (which contains gcc).
You have to specifically select gcc when installing Cygwin.
__________________
--_Peter Vanroose,
__IBM Certified Database Administrator, DB2 9 for z/OS
__IBM Certified Application Developer
__ABIS Training and Consulting
__http://www.abis.be/
Reply With Quote
  #7 (permalink)  
Old 02-28-06, 03:52
lehare lehare is offline
Registered User
 
Join Date: Feb 2006
Posts: 13
Thanx Peter.Vanroose for the replies,

i managed to make db2 development center to see the gcc.exe but now i get an error from the gcc it self
__________________________________________________ _______________
connect to CWREPOS user webuser USING
Database Connection Information
Database server = DB2/NT 8.1.6
SQL authorization ID = WEBUSER
Local database alias = CWREPOS

drop table result
DB20000I The SQL command completed successfully.
create table result (text VARCHAR(80))
DB20000I The SQL command completed successfully.
drop procedure TestProcedure
DB21034E The command was processed as an SQL statement because it was not a
valid Command Line Processor command. During SQL processing it returned:
SQL0204N "WEBUSER.TESTPROCEDURE" is an undefined name. SQLSTATE=42704

create procedure TestProcedure ()
BEGIN
insert
into result (text)
values ('if you can read this, it worked.');
END
DB21034E The command was processed as an SQL statement because it was not a
valid Command Line Processor command. During SQL processing it returned:
SQL7032N SQL procedure "TESTPROCEDURE" not created. Diagnostic file is
"P0395807.log". SQLSTATE=42904

-- LOG FILE P0395807.log FOR PROCEDURE WEBUSER .TESTPROCEDURE
-- DB2_SQLROUTINE_PREPOPTS=
-- PREP/BIND MESSAGES FOR C:\PROGRA~1\IBM\SQLLIB\function\routine\sqlproc\CW REPOS\WEBUSER\tmp\P0395807.sqc

LINE MESSAGES FOR P0395807.sqc
------ --------------------------------------------------------------------
SQL0060W The "C" precompiler is in progress.
SQL0091W Precompilation or binding was ended with "0"
errors and "0" warnings.
-- DB2_SQLROUTINE_COMPILE_COMMAND=c:\bin\db2gcc.bat SQLROUTINE_FILENAME
-- CONTENTS OF C:\PROGRA~1\IBM\SQLLIB\function\routine\sr_cpath.b at
-- CONTENTS OF C:\PROGRA~1\IBM\SQLLIB\function\routine\sqlproc\CW REPOS\WEBUSER\tmp\P0395807.BAT
@echo on
set SQLROUTINE_FILENAME=P0395807
set db2path=C:\PROGRA~1\IBM\SQLLIB
-- COMPILATION COMMAND:
c:\bin\db2gcc.bat P0395807

-- CONTENTS OF C:\PROGRA~1\IBM\SQLLIB\function\routine\sqlproc\CW REPOS\WEBUSER\tmp\P0395807.def
LIBRARY P0395807
EXPORTS _pgsjmp@8
pgsjmp=_pgsjmp@8

-- COMPILATION MESSAGES FOR C:\PROGRA~1\IBM\SQLLIB\function\routine\sqlproc\CW REPOS\WEBUSER\tmp\P0395807.c

-- C COMPILATION ERROR CODES: 0 0 1
C:\PROGRA~1\IBM\SQLLIB\function\routine\sqlproc\CW REPOS\WEBUSER\tmp>set SQLROUTINE_FILENAME=P0395807
C:\PROGRA~1\IBM\SQLLIB\function\routine\sqlproc\CW REPOS\WEBUSER\tmp>set db2path=C:\PROGRA~1\IBM\SQLLIB
C:\PROGRA~1\IBM\SQLLIB\function\routine\sqlproc\CW REPOS\WEBUSER\tmp>c:\bin\db2gcc.bat P0395807
C:\PROGRA~1\IBM\SQLLIB\function\routine\sqlproc\CW REPOS\WEBUSER\tmp>setlocal
C:\PROGRA~1\IBM\SQLLIB\function\routine\sqlproc\CW REPOS\WEBUSER\tmp>REM Set the DB2PATH variable to <strong>your</strong> DB2 base path, e.g., c:\ibm\sqllib
C:\PROGRA~1\IBM\SQLLIB\function\routine\sqlproc\CW REPOS\WEBUSER\tmp>REM Set CYGWIN to <strong>your</strong> top-level CYGWIN directory.
C:\PROGRA~1\IBM\SQLLIB\function\routine\sqlproc\CW REPOS\WEBUSER\tmp>set DB2PATH=c:\Progra~1\ibm\sqllib
C:\PROGRA~1\IBM\SQLLIB\function\routine\sqlproc\CW REPOS\WEBUSER\tmp>set CYGWIN=c:\cygwin\bin
C:\PROGRA~1\IBM\SQLLIB\function\routine\sqlproc\CW REPOS\WEBUSER\tmp>gcc -c -g -mno-cygwin -Ic:\Progra~1\ibm\sqllib\include -Ic:\cygwin\bin\usr\include P0395807.c -o P0395807.o
C:\PROGRA~1\IBM\SQLLIB\function\routine\sqlproc\CW REPOS\WEBUSER\tmp>sed -e s/\_// P0395807.def 1>P0395807_m.def
C:\PROGRA~1\IBM\SQLLIB\function\routine\sqlproc\CW REPOS\WEBUSER\tmp>dllwrap -mno-cygwin -target i386-mingw32 -o P0395807.dll P0395807.o c:\Progra~1\ibm\sqllib\lib\db2api.lib --def P0395807_m.def
gcc: installation problem, cannot exec 'cc1': No such file or directory
'sed' is not recognized as an internal or external command,
operable program or batch file.
gcc: P0395807.o: No such file or directory
dllwrap: gcc exited with status 1

-- END OF LOG FILE (SQLCODE: -7032)
call TestProcedure
SQL0440N No authorized routine named "TESTPROCEDURE" of type "PROCEDURE"
having compatible arguments was found. SQLSTATE=42884
select text from result
TEXT
--------------------------------------------------------------------------------
0 record(s) selected.
terminate
DB20000I The TERMINATE command completed successfully.

i'm currently researching on this error as it seems common on google ... any idieas?

regards lehare
Reply With Quote
  #8 (permalink)  
Old 02-28-06, 04:11
lehare lehare is offline
Registered User
 
Join Date: Feb 2006
Posts: 13
I even added the directory c:\cygwin\lib\gcc\i686-pc-cygwin\3.4.4 to the path variable and this did not change the situation!!
Reply With Quote
  #9 (permalink)  
Old 02-28-06, 05:00
Peter.Vanroose Peter.Vanroose is offline
Registered User
 
Join Date: Sep 2004
Location: Belgium
Posts: 1,079
That's indeed strange. Especially the "sed not found" message. So verify that C:\cygwin\bin\sed.exe is present, or else install it. (It's a separate cygwin package, I believe.)

c:\cygwin\lib\gcc\i686-pc-cygwin\3.4.4 should never be in PATH.
gcc finds out about its executables from its configuration file c:\cygwin\lib\gcc\i686-pc-cygwin\3.4.4\specs
but that file is hard-coded into the gcc executable.

I've never tried to use gcc for compiling DB2 stored procs, so I cannot compare your setup with mine. (I'm using gcc for compiling C applications with embedded SQL.)

Did you follow the steps as described in http://www-128.ibm.com/developerwork...306haungs.html ?
__________________
--_Peter Vanroose,
__IBM Certified Database Administrator, DB2 9 for z/OS
__IBM Certified Application Developer
__ABIS Training and Consulting
__http://www.abis.be/

Last edited by Peter.Vanroose; 02-28-06 at 05:06.
Reply With Quote
  #10 (permalink)  
Old 02-28-06, 10:25
lehare lehare is offline
Registered User
 
Join Date: Feb 2006
Posts: 13
Thanx Peter.Vanroose,

the code finaly compiled successfully after re-installing and selecting the sed.exe package ...

thanx for your help
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On