Re: grantpt, unlockpt bug

2011-09-20 Thread Christopher Faylor
On Tue, Sep 20, 2011 at 04:45:42PM -0600, Eric Blake wrote:
>Bruno Haible reported that grantpt and unlockpt report success even on 
>invalid fds.  This program fails the assertion at line 7:
>
>#include 
>#include 
>#include 
>#include 
>int main (void)
>{
>   assert (grantpt (-1) == -1);
>   assert (errno == EBADF);
>   errno = 0;
>   assert (grantpt (99) == -1);
>   assert (errno == EBADF);
>   return 0;
>}

I checked in a simple fix for this.

cgf

--
Problem reports:   http://cygwin.com/problems.html
FAQ:   http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple



Re: argp?

2011-09-20 Thread Andrew Schulman
> On 09/20/2011 11:59 AM, Andrew Schulman wrote:
> >>>
> >>> http://ftp.gnu.org/gnu/cpio/cpio-2.11.tar.gz
> >>>
> >>> See gnu/argp* .  Looks like a complete implementation, all GPL.
> 
> cpio borrows argp from gnulib, and in gnulib, argp is GPL (because it 
> has some improvements over glibc) but maintains sync with glibc fixes.

Thanks for the pointers.  I just looked in gnulib, and it shows argp as
LGPL.  I can import it using gnulib-tool --lgpl.

I see that I could just import argp from gnulib into my program source, but
my program is actually pretty simple and it seems silly to have its code
dominated by argp.  So I think I'd still rather package libargp separately,
to simplify my code and make it easier for others who may want to use it.


--
Problem reports:   http://cygwin.com/problems.html
FAQ:   http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple



[ANNOUNCEMENT] Updated: mingw64-x86_64-gcc-4.5.3-3

2011-09-20 Thread JonY
Version 4.5.3-3 of mingw64-x86_64-gcc has been uploaded.

mingw64-x86_64-gcc contains GCC for the MinGW-w64 Win64 toolchain.

This version fixes a typo used for gcc configure, anybody using this
toolchain for C++ development are encouraged to rebuild their libraries.

  *** CYGWIN-ANNOUNCE UNSUBSCRIBE INFO ***

If you want to unsubscribe from the cygwin-announce mailing list, look
at the "List-Unsubscribe: " tag in the email header of this message.
Send email to the address specified there. It will be in the format:

cygwin-announce-unsubscribe-you=yourdomain@cygwin.com

If you need more information on unsubscribing, start reading here:

http://sourceware.org/lists.html#unsubscribe-simple

Please read *all* of the information on unsubscribing that is available
starting at this URL.

--
Problem reports:   http://cygwin.com/problems.html
FAQ:   http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple



[ANNOUNCEMENT] Updated: mingw64-i686-gcc-4.5.3-3

2011-09-20 Thread JonY
Version 4.5.3-3 of mingw64-i686-gcc has been uploaded.

mingw64-i686-gcc contains GCC for the MinGW-w64 Win32 toolchain.

This version fixes a typo used for gcc configure, anybody using this
toolchain for C++ development are encouraged to rebuild their libraries.

  *** CYGWIN-ANNOUNCE UNSUBSCRIBE INFO ***

If you want to unsubscribe from the cygwin-announce mailing list, look
at the "List-Unsubscribe: " tag in the email header of this message.
Send email to the address specified there. It will be in the format:

cygwin-announce-unsubscribe-you=yourdomain@cygwin.com

If you need more information on unsubscribing, start reading here:

http://sourceware.org/lists.html#unsubscribe-simple

Please read *all* of the information on unsubscribing that is available
starting at this URL.

--
Problem reports:   http://cygwin.com/problems.html
FAQ:   http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple



Re: Permission denied but have permission

2011-09-20 Thread Larry Hall (Cygwin)

On 9/20/2011 6:53 PM, Lou U wrote:


I am a newbie running cygwin on Windows 7. I want to run an installer for
graphics software, Dislin.
$./setup.exe
bash: ./setup.exe Permission denied
Permissions for setup.exe are -rwxrwxrwx+
setup will run in a Windows Command window. I'm wondering if that "+" in the
permissions is a problem. If so, how do I circumvent it? Any help would be
appreciated.


Please read and follow the problem reporting guidelines found at this
link: 

Also include in your report whether the program you're running is in a
local directory or a network one and, if the latter, a description of
the server and file system type.  Also, the results of 'getfacl ./setup.exe'
may be instructive.  The '+' in the 'ls -l' output indicates that there is
an ACL for the file with additional permissions.  'getfacl' will display
those permissions.


--
Larry

_

A: Yes.
> Q: Are you sure?
>> A: Because it reverses the logical flow of conversation.
>>> Q: Why is top posting annoying in email?

--
Problem reports:   http://cygwin.com/problems.html
FAQ:   http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple



Permission denied but have permission

2011-09-20 Thread Lou U

I am a newbie running cygwin on Windows 7. I want to run an installer for
graphics software, Dislin.
$./setup.exe
bash: ./setup.exe Permission denied
Permissions for setup.exe are -rwxrwxrwx+
setup will run in a Windows Command window. I'm wondering if that "+" in the
permissions is a problem. If so, how do I circumvent it? Any help would be
appreciated.
Lou
-- 
View this message in context: 
http://old.nabble.com/Permission-denied-but-have-permission-tp32502415p32502415.html
Sent from the Cygwin list mailing list archive at Nabble.com.


--
Problem reports:   http://cygwin.com/problems.html
FAQ:   http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple



grantpt, unlockpt bug

2011-09-20 Thread Eric Blake
Bruno Haible reported that grantpt and unlockpt report success even on 
invalid fds.  This program fails the assertion at line 7:


#include 
#include 
#include 
#include 
int main (void)
{
  assert (grantpt (-1) == -1);
  assert (errno == EBADF);
  errno = 0;
  assert (grantpt (99) == -1);
  assert (errno == EBADF);
  return 0;
}

--
Eric Blake   ebl...@redhat.com+1-801-349-2682
Libvirt virtualization library http://libvirt.org

--
Problem reports:   http://cygwin.com/problems.html
FAQ:   http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple



Re: argp?

2011-09-20 Thread Eric Blake

On 09/20/2011 11:59 AM, Andrew Schulman wrote:


http://ftp.gnu.org/gnu/cpio/cpio-2.11.tar.gz

See gnu/argp* .  Looks like a complete implementation, all GPL.


cpio borrows argp from gnulib, and in gnulib, argp is GPL (because it 
has some improvements over glibc) but maintains sync with glibc fixes.


If you're going to pull it from anywhere, I suggest either glibc (LGPL) 
or gnulib (GPL, and what is used by cpio and tar, at least).  Either 
way, I agree that we're stuck with a separate libargp, because I don't 
know of any non-[L]GPL argp implementation.


--
Eric Blake   ebl...@redhat.com+1-801-349-2682
Libvirt virtualization library http://libvirt.org

--
Problem reports:   http://cygwin.com/problems.html
FAQ:   http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple



Re: argp?

2011-09-20 Thread Andrew Schulman
> On Tue, Sep 20, 2011 at 01:20:10PM -0400, Andrew Schulman wrote:
> >> LGPLed code is fine.  It just can't be built into the Cygwin DLL.  So,
> >> if you're looking into packaging anything, I'd use the latest you can
> >> find.
> >> 
> >> Or, if you can find an implementation with a "better" license, I'll
> >> happily pull it into Cygwin itself.
> >
> >http://ftp.gnu.org/gnu/cpio/cpio-2.11.tar.gz
> >
> >See gnu/argp* .  Looks like a complete implementation, all GPL.
> 
> I guess I'm not being clear because I thought this was understood.  We
> can't pull GPLed stuff into the Cygwin DLL because Red Hat won't allow
> it.  We can pull in BSD licensed stuff and, in some cases, public domain
> stuff.  If above is GPLed then it is obviously not something that can
> be pulled into the DLL.

OK.  No, I didn't know about that, but then I'm not good at understanding
software licenses.  My otherwise reliable brain pretty much just skips
right over them.

No problem, I'll be glad to package libargp.  I'll see what the latest
versions are I can find that are GPL and LGPL, and pick the LGPL one if
it's not too old.


--
Problem reports:   http://cygwin.com/problems.html
FAQ:   http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple



Re: argp?

2011-09-20 Thread Christopher Faylor
On Tue, Sep 20, 2011 at 01:20:10PM -0400, Andrew Schulman wrote:
>> LGPLed code is fine.  It just can't be built into the Cygwin DLL.  So,
>> if you're looking into packaging anything, I'd use the latest you can
>> find.
>> 
>> Or, if you can find an implementation with a "better" license, I'll
>> happily pull it into Cygwin itself.
>
>http://ftp.gnu.org/gnu/cpio/cpio-2.11.tar.gz
>
>See gnu/argp* .  Looks like a complete implementation, all GPL.

I guess I'm not being clear because I thought this was understood.  We
can't pull GPLed stuff into the Cygwin DLL because Red Hat won't allow
it.  We can pull in BSD licensed stuff and, in some cases, public domain
stuff.  If above is GPLed then it is obviously not something that can
be pulled into the DLL.

If this is being pulled into a separate package for Cygwin (which would
be fine) it would probably be best if it was LGPLed since that license
would be less of a burden for the users of the library.

cgf

--
Problem reports:   http://cygwin.com/problems.html
FAQ:   http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple



Re: argp?

2011-09-20 Thread Andrew Schulman
> LGPLed code is fine.  It just can't be built into the Cygwin DLL.  So,
> if you're looking into packaging anything, I'd use the latest you can
> find.
> 
> Or, if you can find an implementation with a "better" license, I'll
> happily pull it into Cygwin itself.

http://ftp.gnu.org/gnu/cpio/cpio-2.11.tar.gz

See gnu/argp* .  Looks like a complete implementation, all GPL.


--
Problem reports:   http://cygwin.com/problems.html
FAQ:   http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple



Re: argp?

2011-09-20 Thread Christopher Faylor
On Tue, Sep 20, 2011 at 01:03:23PM -0400, Andrew Schulman wrote:
>> On Mon, Sep 19, 2011 at 04:43:45AM -0400, Andrew Schulman wrote:
>> >I'd like to use argp[1] in a Cygwin program, but I see that it's not
>> >implemented in Cygwin.  The catgets and cpio packages have apparently
>> >imported it statically into their source, and advice on the net is to
>> >import their implementations.
>> >
>> >Is there a particular reason that argp isn't available in Cygwin, or has it
>> >just never been important enough for someone to bring it in?  Would people
>> >be receptive to having it available as a separate package, say libargp?
>> >
>> >[1] http://www.gnu.org/s/hello/manual/libc/Argp.html
>> 
>> Looks like this would have to be implemented from scratch since LGPLed code
>> is not allowed in Cygwin.  The argp implementation in newlib apparently is
>> just a copy of the glibc code.
>> 
>> I was going to just pull in any *bsd version of this that I could find but
>> I don't see a non LGPLed version in freebsd, netbsd, or openbsd.
>> 
>> So:  PTC.
>
>Ugh.  That's a bummer.  Packaging argp as libargp for Cygwin - I was
>getting ready to do that.  Reimplementing it from scratch - no way can I
>tackle that.
>
>Now I'm looking in the argp sources used in catgets and cpio.  Comparing
>them, it appears that catgets is using LGPL code from 2004, while cpio uses
>GPL code from 2010.  I just looked at cpio upstream, and sure enough, it
>includes a GPL argp implementation.  I'll look into packaging it.

LGPLed code is fine.  It just can't be built into the Cygwin DLL.  So,
if you're looking into packaging anything, I'd use the latest you can
find.

Or, if you can find an implementation with a "better" license, I'll
happily pull it into Cygwin itself.

cgf

--
Problem reports:   http://cygwin.com/problems.html
FAQ:   http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple



Re: argp?

2011-09-20 Thread Andrew Schulman
> On Mon, Sep 19, 2011 at 04:43:45AM -0400, Andrew Schulman wrote:
> >I'd like to use argp[1] in a Cygwin program, but I see that it's not
> >implemented in Cygwin.  The catgets and cpio packages have apparently
> >imported it statically into their source, and advice on the net is to
> >import their implementations.
> >
> >Is there a particular reason that argp isn't available in Cygwin, or has it
> >just never been important enough for someone to bring it in?  Would people
> >be receptive to having it available as a separate package, say libargp?
> >
> >[1] http://www.gnu.org/s/hello/manual/libc/Argp.html
> 
> Looks like this would have to be implemented from scratch since LGPLed code
> is not allowed in Cygwin.  The argp implementation in newlib apparently is
> just a copy of the glibc code.
> 
> I was going to just pull in any *bsd version of this that I could find but
> I don't see a non LGPLed version in freebsd, netbsd, or openbsd.
> 
> So:  PTC.

Ugh.  That's a bummer.  Packaging argp as libargp for Cygwin - I was
getting ready to do that.  Reimplementing it from scratch - no way can I
tackle that.

Now I'm looking in the argp sources used in catgets and cpio.  Comparing
them, it appears that catgets is using LGPL code from 2004, while cpio uses
GPL code from 2010.  I just looked at cpio upstream, and sure enough, it
includes a GPL argp implementation.  I'll look into packaging it.


--
Problem reports:   http://cygwin.com/problems.html
FAQ:   http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple



Re: argp?

2011-09-20 Thread Christopher Faylor
On Mon, Sep 19, 2011 at 04:43:45AM -0400, Andrew Schulman wrote:
>I'd like to use argp[1] in a Cygwin program, but I see that it's not
>implemented in Cygwin.  The catgets and cpio packages have apparently
>imported it statically into their source, and advice on the net is to
>import their implementations.
>
>Is there a particular reason that argp isn't available in Cygwin, or has it
>just never been important enough for someone to bring it in?  Would people
>be receptive to having it available as a separate package, say libargp?
>
>[1] http://www.gnu.org/s/hello/manual/libc/Argp.html

Looks like this would have to be implemented from scratch since LGPLed code
is not allowed in Cygwin.  The argp implementation in newlib apparently is
just a copy of the glibc code.

I was going to just pull in any *bsd version of this that I could find but
I don't see a non LGPLed version in freebsd, netbsd, or openbsd.

So:  PTC.

cgf

--
Problem reports:   http://cygwin.com/problems.html
FAQ:   http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple



Re: libc project ports

2011-09-20 Thread Christopher Faylor
On Tue, Sep 20, 2011 at 11:31:55AM +, Greg Chicares wrote:
>On 2011-09-20 10:51Z, toto titi wrote:
>> 
>> I sent a few years ago a question to the libc project ports mailing
>> list (http://cygwin.com/ml/libc-ports/) without knowing this email
>> would be stored and made available to everyone on the internet. My
>> name and main email address clearly appears in it and it really
>> bothers me. I seriously would like this email (and the 2 answers which
>> also contain my personal references) to be removed from public access
>> and removed from your database.
>> I searched your website without finding any particular help for doing
>> this. Could you help me please ?
>
>Answered here:
>  http://www.cygwin.com/ml/#archive-archive
>
>The message you sent less than an hour ago is already archived on
>at least two external sites:
>  http://www.mail-archive.com/cygwin [at] cygwin.com/msg118142.html
>  http://comments.gmane.org/gmane.os.cygwin/128611

...and libc-ports is not a "Cygwin" project.  cygwin.com is an alias
for sourceware.org.  libc-ports is a mailing list hosted by sourceware.org
which has no ties whatsoever to Cygwin.

The answer that Greg gives is still the same however.  We don't edit the
archives.

--
Problem reports:   http://cygwin.com/problems.html
FAQ:   http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple



Re: EXTERNAL: Re: Cygwin too slow while installing and working

2011-09-20 Thread João Moreira
On Wed, Sep 14, 2011 at 7:40 PM, Larry Hall (Cygwin) wrote:
>
> On 9/14/2011 2:22 PM, João Moreira wrote:
>>
>> I checked the BLODA list again and I only had Avira installed.
>> Could it have something to do with a windows update? I keep my OS updated.
>
> No, but you're on the right track in thinking beyond the BLODA list.  That's
> a list apps known to cause problems.  But it can't be seen as a complete
> list.  So it's worth reviewing other things you have installed.
>
>> I got Procmon and messed around with it a little but i honestly don't
>> know how I can use it to pin down the problem.
>> Could you help me guys?
>
> You're looking for processes that are running while you're in the middle
> of a slow operation, particularly if they are getting more CPU than your
> Cygwin process or are trying to access the same files.
>

I ran Procmon. During startup of cygwin, which took about 40 seconds,
the only processes running besides bash.exe were:

cmd.exe
csrss.exe
conhost.exe

SearchProtocolHost.exe
SearchIndexer.exe
EXPLORER.EXE

svchost.exe
id.exe
hostname.exe
grep.exe
echo.exe

The first 3 only showed briefly at the start.
The search and explorer exes appeared during short intervals which I
guess is normal.
Of the last 5, id.exe appeared the most and hostname.exe the least.

I noticed that bash.exe accessed a lot of windows system files.

Don't know If i am applying the correct filters though...(I used the
default filter)

João

--
Problem reports:   http://cygwin.com/problems.html
FAQ:   http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple



Re: OverflowError with bzr 2.4.0-1 [attn: bzr maintainer]

2011-09-20 Thread Ken Brown

On 9/5/2011 7:43 AM, Ronald Blaschke wrote:

I recently upgraded the bzr package to this version:

Bazaar (bzr) 2.4.0
   Python interpreter: /usr/bin/python 2.6.5
   Python standard library: /usr/lib/python2.6
   Platform: CYGWIN_NT-6.1-WOW64-1.7.9-0.237-5-3-i686-32bit

Now I receive the following error message during "bzr status" on a branch.

bzr: ERROR: exceptions.OverflowError: can't convert negative value to
unsigned long

Traceback (most recent call last):
[snip]
   File "/usr/lib/python2.6/site-packages/bzrlib/delta.py", line 127, in
_compare_trees
 want_unversioned=want_unversioned):
   File "_dirstate_helpers_pyx.pyx", line 1459, in
bzrlib._dirstate_helpers_pyx.ProcessEntryC.__next__
(bzrlib/_dirstate_helpers_pyx.c:12147)
   File "_dirstate_helpers_pyx.pyx", line 1732, in
bzrlib._dirstate_helpers_pyx.ProcessEntryC._iter_next
(bzrlib/_dirstate_helpers_pyx.c:14909)
   File "_dirstate_helpers_pyx.pyx", line 1831, in
bzrlib._dirstate_helpers_pyx.ProcessEntryC._loop_one_block
(bzrlib/_dirstate_helpers_pyx.c:15778)
   File "_dirstate_helpers_pyx.pyx", line 1156, in
bzrlib._dirstate_helpers_pyx.ProcessEntryC._process_entry
(bzrlib/_dirstate_helpers_pyx.c:8261)
   File "_dirstate_helpers_pyx.pyx", line 873, in
bzrlib._dirstate_helpers_pyx._update_entry
(bzrlib/_dirstate_helpers_pyx.c:5835)
   File "_dirstate_helpers_pyx.pyx", line 827, in
bzrlib._dirstate_helpers_pyx._pack_stat
(bzrlib/_dirstate_helpers_pyx.c:5547)
OverflowError: can't convert negative value to unsigned long

There is no issue with bzr 2.3.1-1.  Also, I have checked out the bzr
2.4.0 source and built it myself ("make extensions"), and this works
just fine as well.


I'm seeing the same error in my bzr repositories (I have several).

Jari?  Ping?

Ken


--
Problem reports:   http://cygwin.com/problems.html
FAQ:   http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple



Re: compilation fails with Win32 API call

2011-09-20 Thread Andrew Schulman
> On 2011-09-20 PM 6:12, Andrew Schulman wrote:
> > I'm trying to compile a program that calls the win32 function
> > SetThreadExecutionState, in kernel32.dll [1].  The link step fails:
>
> please define WINVER so that you can get definition what you want
> (gcc -E -DWINVER=0x500 - < #include 
> EOF
> )|grep SetThreadExecution

Thanks jojelino, and JonY too.  -DWINVER=0x500 did the trick.
Andrew.


--
Problem reports:   http://cygwin.com/problems.html
FAQ:   http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple



Re: libc project ports

2011-09-20 Thread Greg Chicares
On 2011-09-20 10:51Z, toto titi wrote:
> 
> I sent a few years ago a question to the libc project ports mailing
> list (http://cygwin.com/ml/libc-ports/) without knowing this email
> would be stored and made available to everyone on the internet. My
> name and main email address clearly appears in it and it really
> bothers me. I seriously would like this email (and the 2 answers which
> also contain my personal references) to be removed from public access
> and removed from your database.
> I searched your website without finding any particular help for doing
> this. Could you help me please ?

Answered here:
  http://www.cygwin.com/ml/#archive-archive

The message you sent less than an hour ago is already archived on
at least two external sites:
  http://www.mail-archive.com/cygwin [at] cygwin.com/msg118142.html
  http://comments.gmane.org/gmane.os.cygwin/128611

--
Problem reports:   http://cygwin.com/problems.html
FAQ:   http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple



libc project ports

2011-09-20 Thread toto titi
Hi

I sent a few years ago a question to the libc project ports mailing
list (http://cygwin.com/ml/libc-ports/) without knowing this email
would be stored and made available to everyone on the internet. My
name and main email address clearly appears in it and it really
bothers me. I seriously would like this email (and the 2 answers which
also contain my personal references) to be removed from public access
and removed from your database.
I searched your website without finding any particular help for doing
this. Could you help me please ?

Regards

--
Problem reports:   http://cygwin.com/problems.html
FAQ:   http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple



Re: compilation fails with Win32 API call

2011-09-20 Thread jojelino

On 2011-09-20 PM 6:12, Andrew Schulman wrote:

I'm trying to compile a program that calls the win32 function
SetThreadExecutionState, in kernel32.dll [1].  The link step fails:

$ gcc -c nosleep.c
$ gcc -o nosleep nosleep.o -lkernel32
nosleep.o:nosleep.c:(.text+0x1f): undefined reference to
`_SetThreadExecutionState'
nosleep.o:nosleep.c:(.text+0x5c): undefined reference to
`_SetThreadExecutionState'
collect2: ld returned 1 exit status

According to the FAQ [2], I shouldn't even have to include -lkernel32.

Can someone please tell me what I'm doing wrong?

Thanks,
Andrew.

[1] http://msdn.microsoft.com/en-us/library/aa373208(VS.85).aspx

here you are.
http://msdn.microsoft.com/en-us/library/aa383745.aspx

[2]
http://www.cygwin.com/faq/faq.programming.html#faq.programming.win32-api



please define WINVER so that you can get definition what you want
(gcc -E -DWINVER=0x500 - <
EOF
)|grep SetThreadExecution

now you can see SetThreadExecutionState is defined


--
Problem reports:   http://cygwin.com/problems.html
FAQ:   http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple



Re: compilation fails with Win32 API call

2011-09-20 Thread JonY
On 9/20/2011 17:12, Andrew Schulman wrote:
> I'm trying to compile a program that calls the win32 function
> SetThreadExecutionState, in kernel32.dll [1].  The link step fails:
> 
> $ gcc -c nosleep.c
> $ gcc -o nosleep nosleep.o -lkernel32
> nosleep.o:nosleep.c:(.text+0x1f): undefined reference to
> `_SetThreadExecutionState'
> nosleep.o:nosleep.c:(.text+0x5c): undefined reference to
> `_SetThreadExecutionState'
> collect2: ld returned 1 exit status
> 
> According to the FAQ [2], I shouldn't even have to include -lkernel32.
> 
> Can someone please tell me what I'm doing wrong?
> 
> Thanks,
> Andrew.
> 
> [1] http://msdn.microsoft.com/en-us/library/aa373208(VS.85).aspx
> [2]
> http://www.cygwin.com/faq/faq.programming.html#faq.programming.win32-api
> 
> 

Hi,

There are a few possible causes.

1) You didn't include windows.h
2) You included it but didn't bump _WIN32_WINNT or equivalent.
3) The declaration is missing from winbase.h




signature.asc
Description: OpenPGP digital signature


compilation fails with Win32 API call

2011-09-20 Thread Andrew Schulman
I'm trying to compile a program that calls the win32 function
SetThreadExecutionState, in kernel32.dll [1].  The link step fails:

$ gcc -c nosleep.c
$ gcc -o nosleep nosleep.o -lkernel32
nosleep.o:nosleep.c:(.text+0x1f): undefined reference to
`_SetThreadExecutionState'
nosleep.o:nosleep.c:(.text+0x5c): undefined reference to
`_SetThreadExecutionState'
collect2: ld returned 1 exit status

According to the FAQ [2], I shouldn't even have to include -lkernel32.

Can someone please tell me what I'm doing wrong?

Thanks,
Andrew.

[1] http://msdn.microsoft.com/en-us/library/aa373208(VS.85).aspx
[2]
http://www.cygwin.com/faq/faq.programming.html#faq.programming.win32-api


--
Problem reports:   http://cygwin.com/problems.html
FAQ:   http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple