Re: Need help in compile and link Pro*C simple program

From: Gerard H. Pille <ghp_at_skynet.be>
Date: Mon, 20 Mar 2006 19:20:48 +0100
Message-ID: <441EF280.9000305_at_skynet.be>


ikhnaton2_at_gmail.com wrote:
> I'm new to Pro*C. I had made a simple program (test.pc) to begin
> programming with Pro*C. My program is as follows:
>
> #include <stdio.h>
> #include <stdlib.h>
> #include
> "/oracle/oracle/app/oracle/product/8.1.7/precomp/public/sqlca.h"
>
> void main()
> {
> char * uid = "/";
> int a;
>
> EXEC SQL CONNECT :uid;
>
> EXEC SQL SELECT count(id) INTO :a
> FROM tab
> WHERE status=4;
> printf("The number of rows is: %d\n", a);
> exit(0);
> }
>
> I compiled from Pro*C to C without any problem using the following
> command:
> $ proc test.pc
>
> Now, I need to compile from C:
> I copied demo_proc.mk from $ORACLE_HOME/precomp/demo/proc and just
> change the line with environment variable SAMPLES to put my program
> name: test. It looks like:
>
> SAMPLE=test
>
> After I execute the make command as follows:
> make -f demo_proc.mk
>
> I just got this line with no output:
> `/oracle/oracle/app/oracle/product/8.1.7/lib/libclntsh.sl' is up to
> date.
>
> Could anyone help me to compile my first file.
>
> My environment:
> Machine: HP-UX B.11.11 U 9000/800
> Pro*C/C++: Release 8.1.7.0.0
> C compiler provided by HP-UX: cc
>
> Thanks in Advance,
>
Just a guess:

make -f demo_proc.mk SAMPLE

or

make -f demo_proc.mk test Received on Mon Mar 20 2006 - 19:20:48 CET

Original text of this message