Re: postgres.h

Lists: pgsql-cygwin
From: Claudio Natoli <claudio(dot)natoli(at)memetrics(dot)com>
To: 'Nupur Pande ' <npande(at)vt(dot)edu>, "'pgsql-cygwin(at)postgresql(dot)org '" <pgsql-cygwin(at)postgresql(dot)org>
Subject: Re: COPY error
Date: 2003-10-30 23:56:38
Message-ID: A02DEC4D1073D611BAE8525405FCCE2B027FE0@harris.memetrics.local
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-cygwin


You might have an additional tab in one of the fields in that row?

Cheers,
Claudio

-----Original Message-----
From: Nupur Pande
To: pgsql-cygwin(at)postgresql(dot)org
Sent: 10/31/03 3:37 AM
Subject: [CYGWIN] COPY error

Hi,
I'm trying to copy data from an excel file into a postgres table. I
saved
the file in .txt format (tab delimited) from Excel (running on Windows
XP
machine) and then ran the d2u utility on the .txt file to convert it
into
unix format on cygwin. The command I executed was COPY [table_name] from
[full path of file name].
I get the following error message:
ERROR: copy: line 1520, Extra data after last expected column
ERROR: copy: line 1520, Extra data after last expected column

Could someone please tell me what I did wrong? I checked the excel table
and
I can't see any extra information on that line.

Thanks a lot..
Nupur

---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?

http://archives.postgresql.org

---
WE HAVE MOVED - PLEASE NOTE OUR NEW CONTACT DETAILS:
THE BASEMENT, 33 EWELL STREET, BALMAIN NSW 2041
TEL: +61 2 9555 1544 FAX: +61 2 9555 6911
Certain disclaimers and policies apply to all email sent from Memetrics.
For the full text of these disclaimers and policies see
http://www.memetrics.com/emailpolicy.html


From: "Nupur Pande" <npande(at)vt(dot)edu>
To: <pgsql-cygwin(at)postgresql(dot)org>
Subject: postgres.h
Date: 2003-11-03 21:12:37
Message-ID: 006901c3a24f$35dfc780$6500a8c0@RANIKHET
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-cygwin

Hi,
I'm trying to compile and run some external functions on postgres. The code
seems to compile and run fine on linux machine. But on cygwin, it gave me
errors saying it couldn't find some files such as "postgres.h",
"server/executor/executor.h", "server/executor/spi.h"

Could someone please tell me where to find these files. My
/usr/include/postgresql/ only includes 1 folder called internal. I checked
google for these files and it seems they should be in a folder
../postgresql/server
But I don't see that in my directories. I have postgresql 7.3.4 installed.

Thanks,
Nupur


From: Jason Tishler <jason(at)tishler(dot)net>
To: Nupur Pande <npande(at)vt(dot)edu>
Cc: pgsql-cygwin(at)postgresql(dot)org
Subject: Re: postgres.h
Date: 2003-11-03 21:41:37
Message-ID: 20031103214137.GE800@tishler.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-cygwin

Nupur,

On Mon, Nov 03, 2003 at 04:12:37PM -0500, Nupur Pande wrote:
> I'm trying to compile and run some external functions on postgres. The
> code seems to compile and run fine on linux machine. But on cygwin, it
> gave me errors saying it couldn't find some files such as
> "postgres.h", "server/executor/executor.h", "server/executor/spi.h"
>
> Could someone please tell me where to find these files. My
> /usr/include/postgresql/ only includes 1 folder called internal. I
> checked google for these files and it seems they should be in a folder
> ../postgresql/server But I don't see that in my directories. I have
> postgresql 7.3.4 installed.

When I package Cygwin PostgreSQL, I only do a "make install". From
src/include/Makefile, we have the following:

# 'make install' installs only those headers needed for client-side
# programming. 'make install-all-headers' installs the whole
# contents of src/include.

Hence, the short-term workaround is to download and unpack the source
tarball.

For the long-term, does anyone having any opinions on whether or not I
should include the "install-all-headers" headers too?

Thanks,
Jason

--
PGP/GPG Key: http://www.tishler.net/jason/pubkey.asc or key servers
Fingerprint: 7A73 1405 7F2B E669 C19D 8784 1AFD E4CC ECF4 8EF6


From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: Jason Tishler <jason(at)tishler(dot)net>
Cc: Nupur Pande <npande(at)vt(dot)edu>, <pgsql-cygwin(at)postgresql(dot)org>
Subject: Re: postgres.h
Date: 2003-11-03 21:45:54
Message-ID: Pine.LNX.4.44.0311032244570.12750-100000@peter.localdomain
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-cygwin

Jason Tishler writes:

> For the long-term, does anyone having any opinions on whether or not I
> should include the "install-all-headers" headers too?

You should. The only reason not to install them is if you are keeping the
source tree around. In a package for general distribution, you definitely
need to include them.

--
Peter Eisentraut peter_e(at)gmx(dot)net


From: "Nupur Pande" <npande(at)vt(dot)edu>
To: "Jason Tishler" <jason(at)tishler(dot)net>
Cc: <pgsql-cygwin(at)postgresql(dot)org>
Subject: Re: postgres.h
Date: 2003-11-03 22:24:48
Message-ID: 009401c3a259$4b0a2150$6500a8c0@RANIKHET
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-cygwin

Is there any specific location where I should untar the files?

Thanks,
Nupur

----- Original Message -----
From: "Jason Tishler" <jason(at)tishler(dot)net>
To: "Nupur Pande" <npande(at)vt(dot)edu>
Cc: <pgsql-cygwin(at)postgresql(dot)org>
Sent: Monday, November 03, 2003 4:41 PM
Subject: Re: [CYGWIN] postgres.h

> Nupur,
>
> On Mon, Nov 03, 2003 at 04:12:37PM -0500, Nupur Pande wrote:
> > I'm trying to compile and run some external functions on postgres. The
> > code seems to compile and run fine on linux machine. But on cygwin, it
> > gave me errors saying it couldn't find some files such as
> > "postgres.h", "server/executor/executor.h", "server/executor/spi.h"
> >
> > Could someone please tell me where to find these files. My
> > /usr/include/postgresql/ only includes 1 folder called internal. I
> > checked google for these files and it seems they should be in a folder
> > ../postgresql/server But I don't see that in my directories. I have
> > postgresql 7.3.4 installed.
>
> When I package Cygwin PostgreSQL, I only do a "make install". From
> src/include/Makefile, we have the following:
>
> # 'make install' installs only those headers needed for client-side
> # programming. 'make install-all-headers' installs the whole
> # contents of src/include.
>
> Hence, the short-term workaround is to download and unpack the source
> tarball.
>
> For the long-term, does anyone having any opinions on whether or not I
> should include the "install-all-headers" headers too?
>
> Thanks,
> Jason
>
> --
> PGP/GPG Key: http://www.tishler.net/jason/pubkey.asc or key servers
> Fingerprint: 7A73 1405 7F2B E669 C19D 8784 1AFD E4CC ECF4 8EF6


From: Jason Tishler <jason(at)tishler(dot)net>
To: Peter Eisentraut <peter_e(at)gmx(dot)net>
Cc: Nupur Pande <npande(at)vt(dot)edu>, pgsql-cygwin(at)postgresql(dot)org
Subject: Re: postgres.h
Date: 2003-11-04 12:30:06
Message-ID: 20031104123006.GA1036@tishler.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-cygwin

Peter,

On Mon, Nov 03, 2003 at 10:45:54PM +0100, Peter Eisentraut wrote:
> Jason Tishler writes:
> > For the long-term, does anyone having any opinions on whether or not
> > I should include the "install-all-headers" headers too?
>
> You should. The only reason not to install them is if you are keeping
> the source tree around. In a package for general distribution, you
> definitely need to include them.

Thanks for the above. I will include them the next time I release the
Cygwin PostgreSQL package. In the meantime, I will upload a separate
"install-all-headers" package to my web site.

Jason

--
PGP/GPG Key: http://www.tishler.net/jason/pubkey.asc or key servers
Fingerprint: 7A73 1405 7F2B E669 C19D 8784 1AFD E4CC ECF4 8EF6


From: Jason Tishler <jason(at)tishler(dot)net>
To: Nupur Pande <npande(at)vt(dot)edu>
Cc: pgsql-cygwin(at)postgresql(dot)org
Subject: Re: postgres.h
Date: 2003-11-04 12:32:51
Message-ID: 20031104123250.GB1036@tishler.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-cygwin

Nupur,

On Mon, Nov 03, 2003 at 05:24:48PM -0500, Nupur Pande wrote:
> Is there any specific location where I should untar the files?

Use the following to install the missing headers:

$ wget -P /tmp http://www.tishler.net/jason/software/postgresql/postgresql-7.3.4-2-install-all-headers.tar.bz2
$ tar -C / -xjf /tmp/postgresql-7.3.4-2-install-all-headers.tar.bz2

Thanks for bring this issue to my attention.

Jason

--
PGP/GPG Key: http://www.tishler.net/jason/pubkey.asc or key servers
Fingerprint: 7A73 1405 7F2B E669 C19D 8784 1AFD E4CC ECF4 8EF6


From: "Nupur Pande" <npande(at)vt(dot)edu>
To: "Jason Tishler" <jason(at)tishler(dot)net>
Cc: <pgsql-cygwin(at)postgresql(dot)org>
Subject: Re: postgres.h
Date: 2003-11-04 15:31:28
Message-ID: 003701c3a2e8$ba6cf100$6500a8c0@RANIKHET
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-cygwin

How do I set path in postgres for it to find all the header files? Now that
everything is installed, I thought it would do that automatically.. but I'm
still getting compiler errors.. Do I have to save my C files in some
particular directory?

Thanks..

----- Original Message -----
From: "Jason Tishler" <jason(at)tishler(dot)net>
To: "Nupur Pande" <npande(at)vt(dot)edu>
Cc: <pgsql-cygwin(at)postgresql(dot)org>
Sent: Tuesday, November 04, 2003 7:32 AM
Subject: Re: [CYGWIN] postgres.h

> Nupur,
>
> On Mon, Nov 03, 2003 at 05:24:48PM -0500, Nupur Pande wrote:
> > Is there any specific location where I should untar the files?
>
> Use the following to install the missing headers:
>
> $ wget -P /tmp
http://www.tishler.net/jason/software/postgresql/postgresql-7.3.4-2-install-all-headers.tar.bz2
> $ tar -C / -xjf /tmp/postgresql-7.3.4-2-install-all-headers.tar.bz2
>
> Thanks for bring this issue to my attention.
>
> Jason
>
> --
> PGP/GPG Key: http://www.tishler.net/jason/pubkey.asc or key servers
> Fingerprint: 7A73 1405 7F2B E669 C19D 8784 1AFD E4CC ECF4 8EF6
>
> ---------------------------(end of broadcast)---------------------------
> TIP 2: you can get off all lists at once with the unregister command
> (send "unregister YourEmailAddressHere" to majordomo(at)postgresql(dot)org)


From: Jason Tishler <jason(at)tishler(dot)net>
To: Nupur Pande <npande(at)vt(dot)edu>
Cc: pgsql-cygwin(at)postgresql(dot)org
Subject: Re: postgres.h
Date: 2003-11-04 16:26:28
Message-ID: 20031104162627.GE1744@tishler.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-cygwin

Nupur,

On Tue, Nov 04, 2003 at 10:31:28AM -0500, Nupur Pande wrote:
> How do I set path in postgres for it to find all the header files? Now
> that everything is installed, I thought it would do that
> automatically.. but I'm still getting compiler errors.. Do I have to
> save my C files in some particular directory?

I presume you would have to do something like the following:

gcc -I/usr/include/postgresql/server ...

Jason

--
PGP/GPG Key: http://www.tishler.net/jason/pubkey.asc or key servers
Fingerprint: 7A73 1405 7F2B E669 C19D 8784 1AFD E4CC ECF4 8EF6


From: "Nupur Pande" <npande(at)vt(dot)edu>
To: <pgsql-cygwin(at)postgresql(dot)org>
Subject: Re: postgres.h
Date: 2003-11-04 18:28:06
Message-ID: 019201c3a301$640f6090$6500a8c0@RANIKHET
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-cygwin

Thanks a lot.. that did work.
One last question (hopefully)
I'm trying to create a .so file. My makefile looks like this:

all: RuleFinder.so

RuleFinder.so: RuleFinder.o
gcc -shared -o RuleFinder.so RuleFinder.o

RuleFinder.o: <files>
gcc -I /usr/include/postgresql/server -fpic -c RuleFinder.c

When I run make, the .o file gets created but not the .so. I get the
following errors:

gcc -I /usr/include/postgresql/server -fpic -c RuleFinder.c
cc1: warning: -fpic ignored for target (all code is position independent)
gcc -shared -o RuleFinder.so RuleFinder.o
RuleFinder.o(.text+0x16c1):RuleFinder.c: undefined reference to `_SPI_exec'
RuleFinder.o(.text+0x1cf2):RuleFinder.c: undefined reference to
`_pg_detoast_datum'
RuleFinder.o(.text+0x1d06):RuleFinder.c: undefined reference to
`_pg_detoast_datum'
RuleFinder.o(.text+0x2152):RuleFinder.c: undefined reference to
`_GetAttributeByName'
RuleFinder.o(.text+0x2438):RuleFinder.c: undefined reference to
`_GetAttributeByName'

Did I do something wrong?

Thanks,
Nupur

----- Original Message -----
From: "Jason Tishler" <jason(at)tishler(dot)net>
To: "Nupur Pande" <npande(at)vt(dot)edu>
Cc: <pgsql-cygwin(at)postgresql(dot)org>
Sent: Tuesday, November 04, 2003 11:26 AM
Subject: Re: [CYGWIN] postgres.h

> Nupur,
>
> On Tue, Nov 04, 2003 at 10:31:28AM -0500, Nupur Pande wrote:
> > How do I set path in postgres for it to find all the header files? Now
> > that everything is installed, I thought it would do that
> > automatically.. but I'm still getting compiler errors.. Do I have to
> > save my C files in some particular directory?
>
> I presume you would have to do something like the following:
>
> gcc -I/usr/include/postgresql/server ...
>
> Jason


From: Frank Seesink <frank(at)mail(dot)wvnet(dot)edu>
To: pgsql-cygwin(at)postgresql(dot)org
Subject: Re: postgres.h
Date: 2003-11-05 00:12:52
Message-ID: bo9fa5$12c$1@sea.gmane.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-cygwin

Nupur,

No, you didn't do anything wrong. The problem is that you have stumbled
into one of the areas where compiling/developing under Cygwin is
different than most forms of *nix. You may find the following
information helpful in general (taken from a README I wrote up for the
Cygwin version of Jabberd v1.4.3 recently; apologies for being lazy):

______________________________________________________________________
COMMENTS ABOUT BUILDING *NIX APPS UNDER CYGWIN

With the modifications made since Jabberd v1.4.2, you should now be able
to build Jabberd under Cygwin just as you would under *nix, with a few
exceptions. For those interested, note that building *nix applications
under Cygwin tends to run into problems in the following areas:

* dynamic libraries
* DNS (Domain Name System) resolution/functionality
* the use of fork()

Unfortunately, Jabberd touches on ALL of these capabilities to some
extent.

Dynamic libraries are an OS-specific feature, requiring the OS to play
its role in loading/unloading libraries. In *nix, dynamic libraries
have filenames ending in .so, whereas in Windows they end in .dll. This
is more cosmetic in nature, but it requires changing all modules such as
JUD or MU-Conference so that their filenames end in .dll (see setup.sh).

More importantly, however, is the fact that *nix and Windows compile
their libraries differently, and in order to make a *nix library
build/work under Cygwin, it requires using certain Cygwin tools to build
a list of EXPORTed functions/variables and then building the libraries
as Windows would expect. See the various Makefiles for details on the
commands used under Cygwin vs. typical *nix builds. Basically it
involves building an EXPORT list via 'nm' and then building the libary
using 'dllwrap'.

DNS is another area where compiling *nix apps under Cygwin falls down
hard. In *nix, you can expect to find BIND (Berkeley Internet Name
Domain) or something like it. This provides you not only with a DNS
server, but also as a programmer with all the functions you might
need for DNS resolution, via libraries like libresolv
(/usr/lib/libresolv.a) and their matching header files like
/usr/include/resolv.h, /usr/include/arpa/nameser.h, etc.

Unfortunately, BIND does not build cleanly under Cygwin (so far one can
only Google for hacks), and there is no BIND package available via
Cygwin's setup.exe. This means that as a programmer, you do not get the
header files or necessary libraries for doing DNS functions. Since
Jabberd does DNS resolution for its 'dialback' feature, this required a
rewrite of that portion of Jabberd for Cygwin. This is the ugliest part
of the Cygwin build, as you will find setup.sh simply overwrites the
standard ./dnsrv subdirectory with the Cygwin-specific version. Thanks
go to whoever did this rewrite, however, as it does work.

Recently I found a handy utility called 'minires' (v0.9.7 as I write
this) which implements the more common BIND libresolv functions,
allowing you to build against it as if you had libresolv.
Unfortunately, in my tests, compilation and linking against minires went
fine, but attempts to run the DNSRV portion (dnsrv.dll) of Jabberd blew
up, kicking up rather nasty errors. Though it did not die, it did not
do DNS resolution either. So for now, we'll stick to the rewrite from
Jabberd v1.4.2.

Finally, fork(). Cygwin is fork()ing hell (pun intended) compared to a
proper *nix environment. Applications which use fork() either directly
or indirectly--as Jabberd does since it uses GNU Pth, which in turn uses
fork()--often have difficulty under Cygwin. As mentioned above, when
attempting to run a version of Jabberd compiled against minires
(basically attempting to build Jabberd under Cygwin as you would do
under *nix), I ran into trouble. The trouble involved fork(). I do not
have a resolution at this time.
______________________________________________________________________

Basically, you cannot use .so files under Cygwin. Dynamic Link
Libraries, or DLLs, in Windows end with .DLL, and the way in which they
are built is different than under *nix.

In most cases you CAN take *nix type source code and, by modifying the
Makefile, compile yourself a .DLL file that will work under Windows. I
would suggest doing a

$ man nm
$ dllwrap --help
$ man dlltool

to learn more. Yes it's a pain, but it can be done. I would give you a
modified version of your Makefile here if it were that simple, but there
are too many assumptions I would have to make, and compiling a .so file
as a .dll requires both a modified Makefile and a wrapper/stub file, an
example of which can be had here (taken from Jabberd project):

http://www.jabberstudio.org/cgi-bin/viewcvs.cgi/*checkout*/jabberd14/cygwin/dllinit.c?rev=1.1&content-type=text/plain

To give you at least some direction in this, look at the following
Makefile (again taken from Jabberd project) for a basic idea of what's
involved:

http://www.jabberstudio.org/cgi-bin/viewcvs.cgi/jabberd14/dialback/Makefile?rev=1.5&content-type=text/vnd.viewcvs-markup

Ignore the actual filenames and just note the general structure. Note
the line at the top "include ../platform-settings" refers to including a
simple shell script file containing compiler flags and such, including
one line that reads "__CYGWIN__=1", which is what the conditionals in
the above Makefile look for to see if you're running under Cygwin. This
platform-settings file was generated by a ./configure script provided
with Jabberd, available here:

http://www.jabberstudio.org/cgi-bin/viewcvs.cgi/jabberd14/configure?rev=1.43&content-type=text/vnd.viewcvs-markup

I realize that saying "Go look at this other code" isn't the prettiest
way to learn, but hopefully it will be of use to you. Best of luck to you.

______________________________________________________________________
DISCLAIMER: I am not a professional coder (i.e., "sitting at desk,
coding for my paycheck"), nor do I play one on TV. So if any of the
above is a little off, an apology is the best I can offer.

Nupur Pande wrote:

> Thanks a lot.. that did work.
> One last question (hopefully)
> I'm trying to create a .so file. My makefile looks like this:
>
> all: RuleFinder.so
>
> RuleFinder.so: RuleFinder.o
> gcc -shared -o RuleFinder.so RuleFinder.o
>
> RuleFinder.o: <files>
> gcc -I /usr/include/postgresql/server -fpic -c RuleFinder.c
>
> When I run make, the .o file gets created but not the .so. I get the
> following errors:
>
> gcc -I /usr/include/postgresql/server -fpic -c RuleFinder.c
> cc1: warning: -fpic ignored for target (all code is position independent)
> gcc -shared -o RuleFinder.so RuleFinder.o
> RuleFinder.o(.text+0x16c1):RuleFinder.c: undefined reference to `_SPI_exec'
> RuleFinder.o(.text+0x1cf2):RuleFinder.c: undefined reference to
> `_pg_detoast_datum'
> RuleFinder.o(.text+0x1d06):RuleFinder.c: undefined reference to
> `_pg_detoast_datum'
> RuleFinder.o(.text+0x2152):RuleFinder.c: undefined reference to
> `_GetAttributeByName'
> RuleFinder.o(.text+0x2438):RuleFinder.c: undefined reference to
> `_GetAttributeByName'
>
> Did I do something wrong?
>
> Thanks,
> Nupur
*snip*


From: Jason Tishler <jason(at)tishler(dot)net>
To: Nupur Pande <npande(at)vt(dot)edu>
Cc: pgsql-cygwin(at)postgresql(dot)org
Subject: Re: postgres.h
Date: 2003-11-05 16:06:20
Message-ID: 20031105160619.GD1792@tishler.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-cygwin

Nupar,

On Tue, Nov 04, 2003 at 01:28:06PM -0500, Nupur Pande wrote:
> Thanks a lot..

You are welcome.

> that did work.

Good.

> Did I do something wrong?

Yes and no.

> I'm trying to create a .so file. My makefile looks like this:
^^^

Under Cygwin (i.e., Windows), you should create .dll files instead.

> all: RuleFinder.so
>
> RuleFinder.so: RuleFinder.o
> gcc -shared -o RuleFinder.so RuleFinder.o
>
> RuleFinder.o: <files>
> gcc -I /usr/include/postgresql/server -fpic -c RuleFinder.c
^^^^^

The -fpic options is unnecessary under Cygwin.

> gcc -shared -o RuleFinder.so RuleFinder.o
> RuleFinder.o(.text+0x16c1):RuleFinder.c: undefined reference to `_SPI_exec'
> [snip]

You are missing the "-lpostgres" option (and possibly the associated
"-L" option too) on the link command line. Unfortunately, the binary
package does *not* contain libpostgres.a. This is because the other
Unix platforms do not have such a file. Sigh...

The short-term workaround is to download the PostgreSQL source and build
libpostgres.a yourself. I need to think about the long-term solution...

Jason

--
PGP/GPG Key: http://www.tishler.net/jason/pubkey.asc or key servers
Fingerprint: 7A73 1405 7F2B E669 C19D 8784 1AFD E4CC ECF4 8EF6


From: Jason Tishler <jason(at)tishler(dot)net>
To: Frank Seesink <frank(at)mail(dot)wvnet(dot)edu>
Cc: pgsql-cygwin(at)postgresql(dot)org
Subject: Re: postgres.h
Date: 2003-11-05 16:10:36
Message-ID: 20031105161036.GE1792@tishler.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-cygwin

Frank,

On Tue, Nov 04, 2003 at 07:12:52PM -0500, Frank Seesink wrote:
> Basically it involves building an EXPORT list via 'nm' and then
> building the libary using 'dllwrap'.

Please recommend using "gcc -shared" instead of "dllwrap".

> Finally, fork(). Cygwin is fork()ing hell (pun intended) compared to
> a proper *nix environment. Applications which use fork() either
> directly or indirectly--as Jabberd does since it uses GNU Pth, which
> in turn uses fork()--often have difficulty under Cygwin. As mentioned
> above, when attempting to run a version of Jabberd compiled against
> minires (basically attempting to build Jabberd under Cygwin as you
> would do under *nix), I ran into trouble. The trouble involved
> fork(). I do not have a resolution at this time.

<WAG>
Try rebasing your system:

http://sources.redhat.com/ml/cygwin-announce/2003-09/msg00039.html
</WAG>

Jason

--
PGP/GPG Key: http://www.tishler.net/jason/pubkey.asc or key servers
Fingerprint: 7A73 1405 7F2B E669 C19D 8784 1AFD E4CC ECF4 8EF6


From: "Nupur Pande" <npande(at)vt(dot)edu>
To: "Jason Tishler" <jason(at)tishler(dot)net>
Cc: <pgsql-cygwin(at)postgresql(dot)org>
Subject: Re: postgres.h
Date: 2003-11-05 20:56:28
Message-ID: 012601c3a3df$48f7f4f0$6500a8c0@RANIKHET
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-cygwin

> The short-term workaround is to download the PostgreSQL source and build
> libpostgres.a yourself. I need to think about the long-term solution...

Are there any instructions posted for that?

Nupur


From: Jason Tishler <jason(at)tishler(dot)net>
To: Nupur Pande <npande(at)vt(dot)edu>
Cc: pgsql-cygwin(at)postgresql(dot)org
Subject: Re: postgres.h
Date: 2003-11-05 21:15:26
Message-ID: 20031105211525.GA1696@tishler.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-cygwin

Nupur,

On Wed, Nov 05, 2003 at 03:56:28PM -0500, Nupur Pande wrote:
> > The short-term workaround is to download the PostgreSQL source and build
> > libpostgres.a yourself. I need to think about the long-term solution...
>
> Are there any instructions posted for that?

The README states the following:

See CYGWIN-PATCHES/build.sh in the source archive for my exact build
recipe for configuring, making, and packaging this distribution.

Jason

--
PGP/GPG Key: http://www.tishler.net/jason/pubkey.asc or key servers
Fingerprint: 7A73 1405 7F2B E669 C19D 8784 1AFD E4CC ECF4 8EF6


From: "Nupur Pande" <npande(at)vt(dot)edu>
To: "Jason Tishler" <jason(at)tishler(dot)net>
Cc: <pgsql-cygwin(at)postgresql(dot)org>
Subject: Re: postgres.h
Date: 2003-11-05 22:12:04
Message-ID: 016201c3a3e9$d885f130$6500a8c0@RANIKHET
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-cygwin

I ran the build.sh file under CYGWIN-PATCHES, but I'm getting some errors
like
configure: No such file or directory
etc etc..
The only configure file I found was in the directory above it. So it seems
that I have to build postgres from scratch. I was assuming that I don't have
to rebuild postgres.. just the library for libpostgres.a, or do I?

Could you please give me precise directions?

Thanks a lot,
Nupur


From: Jason Tishler <jason(at)tishler(dot)net>
To: Nupur Pande <npande(at)vt(dot)edu>
Cc: pgsql-cygwin(at)postgresql(dot)org
Subject: Re: postgres.h
Date: 2003-11-06 03:24:15
Message-ID: 20031106032415.GB1340@tishler.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-cygwin

Nupur,

On Wed, Nov 05, 2003 at 05:12:04PM -0500, Nupur Pande wrote:
> Could you please give me precise directions?

Use the following (after installing all necessary Cygwin packages):

$ wget -P /tmp http://mirrors.rcn.net/pub/sourceware/cygwin/release/postgresql/postgresql-7.3.4-2-src.tar.bz2
$ tar -xjf /tmp/postgresql-7.3.4-2-src.tar.bz2
$ cd postgresql-7.3.4-2
$ configure --enable-multibyte --prefix=/usr
$ make
$ cp src/backend/libpostgres.a /usr/lib

Now you can just add -lpostgres to your link command line.

Jason

--
PGP/GPG Key: http://www.tishler.net/jason/pubkey.asc or key servers
Fingerprint: 7A73 1405 7F2B E669 C19D 8784 1AFD E4CC ECF4 8EF6


From: "Nupur Pande" <npande(at)vt(dot)edu>
To: "Jason Tishler" <jason(at)tishler(dot)net>
Cc: <pgsql-cygwin(at)postgresql(dot)org>
Subject: Re: postgres.h
Date: 2003-11-06 16:37:23
Message-ID: 014f01c3a484$4208b0d0$6500a8c0@RANIKHET
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-cygwin


I did exactly that, but it still doesn't work. I don't think -lpostgres is
not working even though my /usr/lib contains libpostgres.a now. I have also
changed libpostgres.a's permission to reflect those of other .a files. The
only difference is the + at the end of the permissions of libpostgres.a
which I'm not sure how to change..

$ ls -Al /usr/lib/libp*
-rwxr-xr-- 1 Nupur Users 2445312 Nov 6 00:06
/usr/lib/libpostgres.a
-rwxr-x---+ 1 Nupur Users 111176 Aug 5 09:31 /usr/lib/libpq.a
-rwxr-x---+ 1 Nupur Users 56086 Sep 20 16:32
/usr/lib/libpthread.a

My makefile looks like this:

RuleFinder.so: RuleFinder.o
gcc -shared -lpostgres -L /usr/lib -o RuleFinder.so RuleFinder.o

RuleFinder.o: <files>
gcc -I /usr/include/postgresql/server -c RuleFinder.c

Thanks for the help!

Nupur

----- Original Message -----
From: "Jason Tishler" <jason(at)tishler(dot)net>
To: "Nupur Pande" <npande(at)vt(dot)edu>
Cc: <pgsql-cygwin(at)postgresql(dot)org>
Sent: Wednesday, November 05, 2003 10:24 PM
Subject: Re: [CYGWIN] postgres.h

> Nupur,
>
> On Wed, Nov 05, 2003 at 05:12:04PM -0500, Nupur Pande wrote:
> > Could you please give me precise directions?
>
> Use the following (after installing all necessary Cygwin packages):
>
> $ wget -P /tmp
http://mirrors.rcn.net/pub/sourceware/cygwin/release/postgresql/postgresql-7.3.4-2-src.tar.bz2
> $ tar -xjf /tmp/postgresql-7.3.4-2-src.tar.bz2
> $ cd postgresql-7.3.4-2
> $ configure --enable-multibyte --prefix=/usr
> $ make
> $ cp src/backend/libpostgres.a /usr/lib
>
> Now you can just add -lpostgres to your link command line.
>
> Jason


From: Jason Tishler <jason(at)tishler(dot)net>
To: Nupur Pande <npande(at)vt(dot)edu>
Cc: pgsql-cygwin(at)postgresql(dot)org
Subject: Re: postgres.h
Date: 2003-11-06 20:51:00
Message-ID: 20031106205100.GB648@tishler.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-cygwin

Nupur,

On Thu, Nov 06, 2003 at 11:37:23AM -0500, Nupur Pande wrote:
> My makefile looks like this:
>
> RuleFinder.so: RuleFinder.o
> gcc -shared -lpostgres -L /usr/lib -o RuleFinder.so RuleFinder.o

Under Cygwin, the order of link command line arguments is important.
Does the following work?

gcc -shared -o RuleFinder.dll RuleFinder.o -lpostgres -L/usr/lib

Note you should use ".dll" not ".so" under Cygwin (i.e., Windows).

> Thanks for the help!

You are welcome, but next please include error messages.

Jason

--
PGP/GPG Key: http://www.tishler.net/jason/pubkey.asc or key servers
Fingerprint: 7A73 1405 7F2B E669 C19D 8784 1AFD E4CC ECF4 8EF6