Re: MSVC build scripts status

From: Magnus Hagander <magnus(at)hagander(dot)net>
To: meskes(at)postgresql(dot)org, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Andrew Dunstan <andrew(at)dunslane(dot)net>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: MSVC build scripts status
Date: 2007-09-25 12:20:34
Message-ID: 20070925122034.GF6308@svr2.hagander.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Sep 25, 2007 at 02:13:05PM +0200, Michael Meskes wrote:
> On Tue, Sep 25, 2007 at 11:07:27AM +0200, Magnus Hagander wrote:
> > Oh, and I'm now seeing failures on my dev box with ECPG on the MSVC build
> > using "the old way" (.bat-files):
> > array_of_struct.c
> > array_of_struct.pgc(26): error C2065: 'customer' : undeclared identifier
> > array_of_struct.pgc(26): error C2146: syntax error : missing ';' before identifier 'custs1'
> > array_of_struct.pgc(26): error C2065: 'custs1' : undeclared identifier
> > array_of_struct.pgc(26): error C2109: subscript requires array or pointer type
> > array_of_struct.pgc(27): error C2065: 'cust_ind' : undeclared identifier
> > array_of_struct.pgc(27): error C2146: syntax error : missing ';' before identifier 'inds'
> > array_of_struct.pgc(27): error C2065: 'inds' : undeclared identifier
> > array_of_struct.pgc(27): error C2109: subscript requires array or pointer type
> > array_of_struct.pgc(33): error C2275: 'customer2' : illegal use of this type as an expression
> > array_of_struct.pgc(32) : see declaration of 'customer2'
>
> I do not have a Windows development setup around, so I never tried
> myself but this looks strange. Could anyone please send me the .c file?
> There are two possible reason: Either ecpg creates different code on
> Windows, or the code that works on all Unix systems does not compile on
> Windows.

Irrk. The C file is very wrong indeed. Here's the relevant part where it
shoudl be declaring 'customer':
/* exec sql type customer is struct { #line 12 "array_of_struct.pgc" struct varchar_name_12 { int len; char arr[ 50 ]; } name ; #line 13 "array_of_struct.pgc" int phone ; } */ #line 14 "array_of_struct.pgc"

(all on one line, in case the MUA wraps it)

Seems like the entire definition of the struct is commented out?

Are we perhaps looking at something broken by Windows newlines?

Anyway, I've attached the full output file.

> P.S.: Is there some documentation available on how to set up a Windows
> build system? Takes less time when you know all software to install
> beforehand and if you get this software at all.

There's a chapter in the developer version of the docs. That combined
withthe README file in src/tools/msvc should get yuo there - especially if
you know a bit of Windows devving beforehand. Suggestions for improvements
are always welcome though, since not a lot of people have built something
off those instructions yet.

//Magnus

Attachment Content-Type Size
array_of_struct.c text/x-csrc 6.9 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Meskes 2007-09-25 12:58:15 Re: MSVC build scripts status
Previous Message Michael Meskes 2007-09-25 12:13:05 Re: MSVC build scripts status