Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Pro*C++ Question .How to Compile multiple .pc files

Re: Pro*C++ Question .How to Compile multiple .pc files

From: Kenneth C Stahl <BluesSax_at_Unforgettable.com>
Date: Tue, 10 Aug 1999 11:37:22 -0400
Message-ID: <37B04732.8AB5E89@Unforgettable.com>


You either need to decide that one of your modules (e.g. the one containing main()) is the master module and only define sqlca there. In other modules you must declare sqlca as an extern. The other alternative is to declare sqlca with static storage in the modules - but I generally don't recommend that because it can cause some confusion as to which sqlca is in effect at any given point (it is something that can be known, but few programmers deal with this situation very well).

To define the storage class of sqlca, see the notes in sqlca.h

Basically what you will read there is that in every module except your master module you will need to have the following line at the to of the source code file:

#define SQLCA_STORAGE_CLASS extern

That way when the module compiles it will expect the sqlca to be defined elsewhere and then at link time it will be resolved to point to the sqlca in your master module.

Ken

justvrk wrote:

> Hi:
>
> I am trying to compile multiple pro*C files into my project under VC++5.
> During the linking phase I get the following error message
>
> pcOraComm.obj : error LNK2005: "struct sqlca sqlca" (?sqlca@@3U0_at_A)
> already defined in ExchUtil.obj
>
> I have two .pc files pcOraComm.pc and ExchUtil.pc which I have
> precompiled successfully.
>
> Can anybody suggest how should I solve this ?
>
> Thanks in Advance.
> Vinayak
>
> Sent via Deja.com http://www.deja.com/
> Share what you know. Learn what you don't.
Received on Tue Aug 10 1999 - 10:37:22 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US