Re: Linux equivalent library for "postgres.lib" from Windows - Mailing list pgsql-general

From Albe Laurenz
Subject Re: Linux equivalent library for "postgres.lib" from Windows
Date
Msg-id A737B7A37273E048B164557ADEF4A58B5397A972@ntex2010i.host.magwien.gv.at
Whole thread Raw
In response to Re: Linux equivalent library for "postgres.lib" from Windows  (John R Pierce <pierce@hogranch.com>)
List pgsql-general
John R Pierce wrote:
>> I am new to the product and in windows “postgres.lib” provides certain functions which we are
>> using in windows for creating extensions.
>> 
>> Now I am porting the project to Linux and there no straight library with this name in Linux
>> binaries packages.
>> 
>> Can someone please advise the equivalent library for postgres.lib in Linux?
> 
> I am not sure what this postgres.lib is, what are the functions you're using ?

With MSVC, you have to link with the mylibrary.lib file if you want to use
functions from the shared library mylibrary.dll.
This is not necessary on Linux, where references to a shared library are resolved
at load time.

So the answer to the original question is that there is no replacement
for postgres.lib on Linux because you don't need it to link with PostgreSQL.
It is enough to #include the required PostgreSQL headers during compilation.

Some information on how to link on Linux can be found here:
https://www.postgresql.org/docs/current/static/xfunc-c.html#DFUNC
But as others have remarked, using PGXS is much better than doing
it by hand.

Yours,
Laurenz Albe

pgsql-general by date:

Previous
From: Durumdara
Date:
Subject: Re: Surviving connections after internet problem
Next
From: Albe Laurenz
Date:
Subject: Re: Surviving connections after internet problem