Robert S. Kissel | 1 Nov 20:03 2010
Picon

Re: pdfedit 0.4.5 Compilation Failure under Cygwin

I shall run the minimal build under cygwin 1.7.7 tonight, when I get
to my office, and shall e-mail the results to you privately,
rather than on the list.

When I looked for an earlier version, I found that there was a
precompiled binary of pdfedit for cygwin for an earlier version (4.*,
but I forget which one exactly, and I'm not at my office as I write
this).  I downloaded and ran this, without a problem, but have not yet
tried building THAT version.

I don't know if there have been successful cygwin builds since then,
and didn't see any "readme" files or other indications with the
pre-compiled version to indicate if any special steps were taken to
build it under cygwin.

However, at least now we know it's POSSIBLE, as O'Brien said to Winston Smith.

On Wed, Oct 27, 2010 at 5:54 AM, Michal Hocko <mstsxfx <at> gmail.com> wrote:
> Can you try to remove also -std parameters from both variables?
> Btw. what if you compile the following program:
> test.c
> ===
> #include <stdlib.h>
>
> int main()
> {
>        mkstemp(NULL);
>        return 0;
> }
> ===
(Continue reading)

Robert S. Kissel | 3 Nov 00:09 2010
Picon

Re: pdfedit 0.4.5 Compilation Failure under Cygwin

On Wed, Oct 27, 2010 at 6:54 AM, Michal Hocko <mstsxfx@...> wrote:
> compile the following program:
> test.c
> ===
> #include <stdlib.h>
> int main()> {mkstemp(NULL);return 0;}
> ===
> Try the following tests:
>[1] gcc -o test test.c
>[2] g++ -o test test.c
>[3] gcc -o test -posix test.c
>[4] g++ -o test -posix test.c
>[5] gcc -o test -posix -std=c99 test.c
>[6] g++ -o test -posix -std=c++98 test.c
>[7] gcc -o test -posix -std=c99 -ansi test.c
>[8] g++ -o test -posix -std=c++98 -ansi test.c

Tests [1], [2], [3], [4] and [7] compile without complaint, and
produce an executable which dies at once with a segmentation fault
when I run it (I can show you the core dump if you're interested).

Test [5] spits out the same warning you reported, viz.,
test.c: In function `main':
test.c:4: warning: implicit declaration of function `mkstemp'
and then builds an executable which dies like the others.

Tests [6] and [8] spit out the error I was seeing when I tried to
compile gfile.cc as part of building pdfedit:
test.c: In function `int main()':
test.c:4: error: `mkstemp' was not declared in this scope
(Continue reading)

Michal Hocko | 3 Nov 07:06 2010
Picon

[SPAM] Re: pdfedit 0.4.5 Compilation Failure under Cygwin

On Tue, Nov 02, 2010 at 07:09:10PM -0400, Robert S. Kissel wrote:
> On Wed, Oct 27, 2010 at 6:54 AM, Michal Hocko <mstsxfx@...> wrote:
> > compile the following program:
> > test.c
> > ===
> > #include <stdlib.h>
> > int main()> {mkstemp(NULL);return 0;}
> > ===
> > Try the following tests:
> >[1] gcc -o test test.c
> >[2] g++ -o test test.c
> >[3] gcc -o test -posix test.c
> >[4] g++ -o test -posix test.c
> >[5] gcc -o test -posix -std=c99 test.c
> >[6] g++ -o test -posix -std=c++98 test.c
> >[7] gcc -o test -posix -std=c99 -ansi test.c
> >[8] g++ -o test -posix -std=c++98 -ansi test.c
> 
> Tests [1], [2], [3], [4] 

Sounds good

> and [7] compile without complaint, and

I am little bit confused by this because I thought that -std parameter
makes a difference but here it looks like -ansi actually do. If you
remember the last attempt we tried to remove -ansi to make thingy
work...

> produce an executable which dies at once with a segmentation fault
(Continue reading)

Robert S. Kissel | 3 Nov 16:23 2010
Picon

Re: [SPAM] Re: pdfedit 0.4.5 Compilation Failure under Cygwin

On Wed, Nov 3, 2010 at 1:06 AM, Michal Hocko <mstsxfx@...> wrote:
> Anyway, could you try to add -D_XOPEN_SOURCE=500 to the tests command
> line:
> g++ -o test -D_XOPEN_SOURCE=500 -posix -std=c++98 test.c
> g++ -o test -D_XOPEN_SOURCE=500 -posix -std=c++98 -ansi test.c
> . . .
> If this works for you then try to add this parameter to Makefile.flags (for both
> variables CONFIG_CFLAGS and CONFIG_CXXFLAGS) and try to compile pdfedit
> again (without running configure).

I shall try that at work this evening, and report back.
Thank you for your continued determination to figure out what's amiss.

------------------------------------------------------------------------------
Achieve Improved Network Security with IP and DNS Reputation.
Defend against bad network traffic, including botnets, malware, 
phishing sites, and compromised hosts - saving your company time, 
money, and embarrassment.   Learn More! 
http://p.sf.net/sfu/hpdev2dev-nov
Robert S. Kissel | 4 Nov 00:08 2010
Picon

Re: [SPAM] Re: pdfedit 0.4.5 Compilation Failure under Cygwin

On Wed, Nov 3, 2010 at 2:06 AM, Michal Hocko <mstsxfx@...> wrote:
> could you try to add -D_XOPEN_SOURCE=500 to the tests command line:

I'm afraid that doesn't help:

$ g++ -o test -D_XOPEN_SOURCE=500 -posix -std=c++98 test.c
test.c: In function `int main()':
test.c:4: error: `mkstemp' was not declared in this scope

$ g++ -o test -D_XOPEN_SOURCE=500 -posix -std=c++98 -ansi test.c
test.c: In function `int main()':
test.c:4: error: `mkstemp' was not declared in this scope

------------------------------------------------------------------------------
The Next 800 Companies to Lead America's Growth: New Video Whitepaper
David G. Thomson, author of the best-selling book "Blueprint to a 
Billion" shares his insights and actions to help propel your 
business during the next growth cycle. Listen Now!
http://p.sf.net/sfu/SAP-dev2dev
Michal Hocko | 4 Nov 10:15 2010
Picon

Re: [SPAM] Re: pdfedit 0.4.5 Compilation Failure under Cygwin

On Wed, Nov 03, 2010 at 07:08:10PM -0400, Robert S. Kissel wrote:
> On Wed, Nov 3, 2010 at 2:06 AM, Michal Hocko <mstsxfx@...> wrote:
> > could you try to add -D_XOPEN_SOURCE=500 to the tests command line:
> 
> I'm afraid that doesn't help:
> 
> $ g++ -o test -D_XOPEN_SOURCE=500 -posix -std=c++98 test.c
> test.c: In function `int main()':
> test.c:4: error: `mkstemp' was not declared in this scope
> 
> 
> $ g++ -o test -D_XOPEN_SOURCE=500 -posix -std=c++98 -ansi test.c
> test.c: In function `int main()':
> test.c:4: error: `mkstemp' was not declared in this scope

OK, could you try with -D_XOPEN_SOURCE_EXTENDED instead of
-D_XOPEN_SOURCE=500. Normally this option should be defined by
_XOPEN_SOURCE>=500 but maybe this is not a case with cygwin. If this is
a case then this is a bug in cygwin.

Thanks!
--

-- 
Michal Hocko

------------------------------------------------------------------------------
The Next 800 Companies to Lead America's Growth: New Video Whitepaper
David G. Thomson, author of the best-selling book "Blueprint to a 
Billion" shares his insights and actions to help propel your 
business during the next growth cycle. Listen Now!
http://p.sf.net/sfu/SAP-dev2dev
(Continue reading)

Robert S. Kissel | 5 Nov 00:34 2010
Picon

Re: [SPAM] Re: pdfedit 0.4.5 Compilation Failure under Cygwin

On Thu, Nov 4, 2010 at 5:15 AM, Michal Hocko <mstsxfx@...> wrote:
> OK, could you try with -D_XOPEN_SOURCE_EXTENDED instead of

I'm afraid -D_XOPEN_SOURCE_EXTENDED switch made no difference:

$ g++ -o test -DXOPEN_SOURCE_EXTENDED -posix -std=c++98 test.c
test.c: In function `int main()':
test.c:4: error: `mkstemp' was not declared in this scope

$ g++ -o test -DXOPEN_SOURCE_EXTENDED -posix -std=c++98 -ansi test.c
test.c: In function `int main()':
test.c:4: error: `mkstemp' was not declared in this scope

------------------------------------------------------------------------------
The Next 800 Companies to Lead America's Growth: New Video Whitepaper
David G. Thomson, author of the best-selling book "Blueprint to a 
Billion" shares his insights and actions to help propel your 
business during the next growth cycle. Listen Now!
http://p.sf.net/sfu/SAP-dev2dev
Michal Hocko | 5 Nov 16:15 2010
Picon

Re: pdfedit 0.4.5 Compilation Failure under Cygwin

Hi,

On Thu, Nov 04, 2010 at 07:34:39PM -0400, Robert S. Kissel wrote:
> On Thu, Nov 4, 2010 at 5:15 AM, Michal Hocko <mstsxfx@...> wrote:
> > OK, could you try with -D_XOPEN_SOURCE_EXTENDED instead of
> 
> I'm afraid -D_XOPEN_SOURCE_EXTENDED switch made no difference:
> 
> $ g++ -o test -DXOPEN_SOURCE_EXTENDED -posix -std=c++98 test.c
> test.c: In function `int main()':
> test.c:4: error: `mkstemp' was not declared in this scope
> 
> $ g++ -o test -DXOPEN_SOURCE_EXTENDED -posix -std=c++98 -ansi test.c
> test.c: In function `int main()':
> test.c:4: error: `mkstemp' was not declared in this scope

This is really strange and I would say that this is a bug in cygwin. The
easiest way around this is the attached patch (see attached) which
basically provides a new parameter to configure which controls all the
x/c++ standard and portability gcc parameters. This way you can add
--enable-portability-flags=no parameter to configure

and all those compiler parameters will vanish and compilation should
pass.

Please note that you have to apply patch and run autoconf to regenerate
the configure script. If you have any problems with that just let me
know and I can send the configure script directly.

Hope this helps.
(Continue reading)

Robert S. Kissel | 5 Nov 16:37 2010
Picon

Re: pdfedit 0.4.5 Compilation Failure under Cygwin

On Fri, Nov 5, 2010 at 11:15 AM, Michal Hocko <mstsxfx@...> wrote:
> easiest way around this is the attached patch
> Please note that you have to apply patch and run autoconf to regenerate
> the configure script. If you have any problems with that just let me
> know and I can send the configure script directly.

I'm afraid I won't be back in my office, where I have cygwin set up,
until Monday evening (U.S. Eastern Standard Time), and so I'll try it
then, and let you know if I need further clarification of how to apply
the patch you've provided and rebuild.  By the way, I did make a
version of the little test file that had the expected buffer as an
argument to mkstemp, and printed out the generated name, just to make
sure that the executables that WERE built (e.g., without any special
compiler switches) actually worked--and the programs DID create and
open temporary files with the appropriate names.

What I may do is clear out the build directory, and redeploy the
delivery source code from the tar file, apply your patch, and see how
that goes, so that we all know what's going on for sure.

------------------------------------------------------------------------------
The Next 800 Companies to Lead America's Growth: New Video Whitepaper
David G. Thomson, author of the best-selling book "Blueprint to a 
Billion" shares his insights and actions to help propel your 
business during the next growth cycle. Listen Now!
http://p.sf.net/sfu/SAP-dev2dev
Michal Hocko | 6 Nov 18:34 2010
Picon

Re: pdfedit 0.4.5 Compilation Failure under Cygwin

On Fri, Nov 05, 2010 at 11:37:11AM -0400, Robert S. Kissel wrote:
> On Fri, Nov 5, 2010 at 11:15 AM, Michal Hocko <mstsxfx@...> wrote:
> > easiest way around this is the attached patch
> > Please note that you have to apply patch and run autoconf to regenerate
> > the configure script. If you have any problems with that just let me
> > know and I can send the configure script directly.
> 
> I'm afraid I won't be back in my office, where I have cygwin set up,
> until Monday evening (U.S. Eastern Standard Time), and so I'll try it
> then, and let you know if I need further clarification of how to apply
> the patch you've provided and rebuild.  By the way, I did make a
> version of the little test file that had the expected buffer as an
> argument to mkstemp, and printed out the generated name, just to make
> sure that the executables that WERE built (e.g., without any special
> compiler switches) actually worked--and the programs DID create and
> open temporary files with the appropriate names.
> 
> What I may do is clear out the build directory, and redeploy the
> delivery source code from the tar file, apply your patch, and see how
> that goes, so that we all know what's going on for sure.

Let's make this easier and use the attached configure script instead of
patching.
--

-- 
Michal Hocko
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.67 for PDFedit 0.4.5.
(Continue reading)


Gmane