Thread: Missing library files??

Missing library files??

From
"Tony Griffiths(RA)"
Date:
Hi,
I've mailed this previously to the novice list, but got no response, so 
hopefully this is more the appropriate place.

I'm trying to invoke the DirectFunctionCall1function as follows:
                       BOX* __tmp;                       Datum d = DirectFunctionCall1(box_in, 
BoxPGetDatum(ret_bbox));                       __tmp = DatumGetBoxP(d); 

(where ret_bbox is a string representation of a box)

from some client side code, but get linker errors stating that:

-> undefined reference to `DirectFunctionCall1(unsigned long 
(*)(FunctionCallInfoData*), unsigned long)'

-->  undefined reference to `box_in(FunctionCallInfoData*)

Is this because I'm calling the function incorrectly, or because I'm 
missing the library in which these functions reside?

Many thanks,


Tony



Re: Missing library files??

From
Tom Lane
Date:
"Tony Griffiths(RA)" <griffitt@cs.man.ac.uk> writes:
> I'm trying to invoke the DirectFunctionCall1function as follows:
> ...
> from some client side code, but get linker errors stating that:

> -> undefined reference to `DirectFunctionCall1(unsigned long 
> (*)(FunctionCallInfoData*), unsigned long)'

> Is this because I'm calling the function incorrectly, or because I'm 
> missing the library in which these functions reside?

There *is* no "library in which those functions reside".  They are
internal to the server and are not designed to be included in
client-side code.
        regards, tom lane


Re: Missing library files??

From
"Tony Griffiths(RA)"
Date:
<br /><br /> Tom Lane wrote:<br /><blockquote cite="mid:3644.1024492428@sss.pgh.pa.us" type="cite"><pre wrap="">"Tony
Griffiths(RA)"<a class="moz-txt-link-rfc2396E" href="mailto:griffitt@cs.man.ac.uk"><griffitt@cs.man.ac.uk></a>
writes:<br/></pre><blockquote type="cite"><pre wrap="">I'm trying to invoke the DirectFunctionCall1function as
follows:<br/>...<br />from some client side code, but get linker errors stating that:<br /></pre></blockquote><pre
wrap=""><br/></pre><blockquote type="cite"><pre wrap="">-> undefined reference to `DirectFunctionCall1(unsigned long
<br/>(*)(FunctionCallInfoData*), unsigned long)'<br /></pre></blockquote><pre wrap=""><br /></pre><blockquote
type="cite"><prewrap="">Is this because I'm calling the function incorrectly, or because I'm <br />missing the library
inwhich these functions reside?<br /></pre></blockquote><pre wrap=""><br />There *is* no "library in which those
functionsreside".  They are<br />internal to the server and are not designed to be included in<br />client-side
code.</pre></blockquote>Fair enough - that's what I half expected. I'm wanting to write some embedded sql that selects
abox attribute from a relation - is there any direct way of retrieving a BOX typed value from the select without having
togo through decoding the retrieved string. I know I can do this using a binary cursor, but this means moving from
embeddedsql.<br /><br /> Thanks,<br /><br /> Tony<br /><br /><br /><br /><blockquote
cite="mid:3644.1024492428@sss.pgh.pa.us"type="cite"><pre wrap=""><br /><br />            regards, tom lane<br
/></pre></blockquote><br/> 

Re: Missing library files??

From
Gavin Sherry
Date:
On Wed, 19 Jun 2002, Tom Lane wrote:

> "Tony Griffiths(RA)" <griffitt@cs.man.ac.uk> writes:
> > I'm trying to invoke the DirectFunctionCall1function as follows:
> > ...
> > from some client side code, but get linker errors stating that:
> 
> > -> undefined reference to `DirectFunctionCall1(unsigned long 
> > (*)(FunctionCallInfoData*), unsigned long)'
> 
> > Is this because I'm calling the function incorrectly, or because I'm 
> > missing the library in which these functions reside?
> 
> There *is* no "library in which those functions reside".  They are
> internal to the server and are not designed to be included in
> client-side code.

You can access this function using the Fast Path Interface. See the libpq
documentation. However, I am unsure why you would want to get access to
this function on the client side.

Gavin




Re: Missing library files??

From
"Tony Griffiths(RA)"
Date:
<br /><br /> Gavin Sherry wrote:<br /><blockquote cite="mid:Pine.LNX.4.21.0206192342270.24742-100000@linuxworld.com.au"
type="cite"><prewrap="">On Wed, 19 Jun 2002, Tom Lane wrote:<br /><br /></pre><blockquote type="cite"><pre
wrap="">"TonyGriffiths(RA)" <a class="moz-txt-link-rfc2396E"
href="mailto:griffitt@cs.man.ac.uk"><griffitt@cs.man.ac.uk></a>writes:<br /></pre><blockquote type="cite"><pre
wrap="">I'mtrying to invoke the DirectFunctionCall1function as follows:<br />...<br />from some client side code, but
getlinker errors stating that:<br /></pre></blockquote><blockquote type="cite"><pre wrap="">-> undefined reference
to`DirectFunctionCall1(unsigned long <br />(*)(FunctionCallInfoData*), unsigned long)'<br
/></pre></blockquote><blockquotetype="cite"><pre wrap="">Is this because I'm calling the function incorrectly, or
becauseI'm <br />missing the library in which these functions reside?<br /></pre></blockquote><pre wrap="">There *is*
no"library in which those functions reside".  They are<br />internal to the server and are not designed to be included
in<br/>client-side code.<br /></pre></blockquote><pre wrap=""><br />You can access this function using the Fast Path
Interface.See the libpq<br />documentation. However, I am unsure why you would want to get access to<br />this function
onthe client side.</pre></blockquote><br /> I'm retrieving a box value via embedded sql, and wanted to use the box_in
methodto decode the retrieved string - unless there's a direct way of retrieving into a variable of the C type BOX??<br
/><br/><blockquote cite="mid:Pine.LNX.4.21.0206192342270.24742-100000@linuxworld.com.au" type="cite"><pre wrap=""><br
/><br/>Gavin<br /><br /><br /></pre></blockquote><br /> 

Re: Missing library files??

From
Tom Lane
Date:
"Tony Griffiths(RA)" <griffitt@cs.man.ac.uk> writes:
> Fair enough - that's what I half expected. I'm wanting to write some 
> embedded sql that selects a box attribute from a relation - is there any 
> direct way of retrieving a BOX typed value from the select without 
> having to go through decoding the retrieved string. I know I can do this 
> using a binary cursor, but this means moving from embedded sql.

The binary representation of BOX wouldn't necessarily be the same on
client and server machines anyway (surely you don't want to wire in
an assumption that client and server are on the same kind of hardware).

I'd say bite the bullet and parse the ASCII string; it's hardly
difficult.
        regards, tom lane


Re: Missing library files??

From
"Tony Griffiths(RA)"
Date:
<br /><br /> Tom Lane wrote:<br /><blockquote cite="mid:4118.1024495564@sss.pgh.pa.us" type="cite"><pre wrap="">"Tony
Griffiths(RA)"<a class="moz-txt-link-rfc2396E" href="mailto:griffitt@cs.man.ac.uk"><griffitt@cs.man.ac.uk></a>
writes:<br/></pre><blockquote type="cite"><pre wrap="">Fair enough - that's what I half expected. I'm wanting to write
some<br />embedded sql that selects a box attribute from a relation - is there any <br />direct way of retrieving a BOX
typedvalue from the select without <br />having to go through decoding the retrieved string. I know I can do this <br
/>usinga binary cursor, but this means moving from embedded sql.<br /></pre></blockquote><pre wrap=""><br />The binary
representationof BOX wouldn't necessarily be the same on<br />client and server machines anyway (surely you don't want
towire in<br />an assumption that client and server are on the same kind of hardware).<br /><br />I'd say bite the
bulletand parse the ASCII string; it's hardly<br />difficult.</pre></blockquote><br /> True, but if you guys decide to
changethe structure of a box string down the line then not too good for backwards compatibility. sscanf here I
come....<br/><br /><blockquote cite="mid:4118.1024495564@sss.pgh.pa.us" type="cite"><pre wrap=""><br /><br />
regards, tom lane<br /></pre></blockquote><br />