Re: Question about Pro*C and .h

From: Tom Best <tombest_at_firstusa.com>
Date: 8 Jul 2001 15:55:36 -0700
Message-ID: <99ab87b0.0107081455.41eda492_at_posting.google.com>


lvaro Palma Aste <apalma.nospam_at_cec.uchile.cl> wrote in message news:<9i1vld$bpn$1_at_news.cec.uchile.cl>...
> I´m writing a program in Pro*C, which have a lot of functions
> that uses SQL statements. This functions are also going to be
> used for a lot of other programs. My idea was to create a
> functions.h file, and link this in all the .pc files using
>
> #include "functions.h"
>
> but when I compile, it returns a lot of error related to the
> fact that can´t exists a library linked through #include with
> SQL statements inside it.
>
> My question is: What other ways to link that library can I use?
>
> I think that I can compile this library as an object code
> (functions.o) and include it using gcc
>
> gcc **** -lfunctions ****
>
> but I´m not sure of the sintax ans the way to do that.
>
> Can somebody give another idea?
>
> Thanks a lot

lvaro:

You can't include object code via a #include statement. Anything in a #included files must be text, as it is compiled right after being included.

Your idea of linking in the the library is right... check out the help for gcc's command line parms and see how to link in a library. You'll also have to find out how to compile the SQL functions into that library.

Good luck.

Tom Best Received on Mon Jul 09 2001 - 00:55:36 CEST

Original text of this message