public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* Re: Linking problem: IsWindowVisible
@ 2000-03-15  7:07 Øystein O Johansen
  0 siblings, 0 replies; 14+ messages in thread
From: Øystein O Johansen @ 2000-03-15  7:07 UTC (permalink / raw)
  To: cygwin

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 232 bytes --]

Well, thanks to Jeff, my program works now. Thanks for the help and thanks
for the interesting discussion.

Thanks all,
Øystein



--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: Linking problem: IsWindowVisible
  2000-03-15  7:06         ` Jeff Sturm
@ 2000-03-15  7:12           ` Axel Riese
  0 siblings, 0 replies; 14+ messages in thread
From: Axel Riese @ 2000-03-15  7:12 UTC (permalink / raw)
  To: Jeff Sturm; +Cc: Øystein O Johansen, Cygwin Mailing List

> > Anyway, adding -mwindows or -luser32
> > should solve the problem.
> 
> IIRC the undefined symbol was 'IsWindowVisible', which is a symptom of a
> different problem.  That symbol isn't defined in any Win32 library...
> 'IsWindowVisible@4' is.

Oops, I correct the above: Anyway, adding -mwindows or -luser32 to the
flags and #include <windows.h> to the code should solve the problem.

- Axel

=======================================================================
Axel Riese
Research Institute for Symbolic Computation
J. Kepler University Linz                     Tel: +43 (0)732 2468 9939
Altenbergerstrasse 69                         Fax: +43 (0)732 2468 9930
A-4040 Linz                      e-Mail: Axel.Riese@risc.uni-linz.ac.at
Austria              http://www.risc.uni-linz.ac.at/people/ariese/home/
=======================================================================

--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: Linking problem: IsWindowVisible
  2000-03-15  6:58       ` Axel Riese
  2000-03-15  7:02         ` Chris Faylor
@ 2000-03-15  7:06         ` Jeff Sturm
  2000-03-15  7:12           ` Axel Riese
  1 sibling, 1 reply; 14+ messages in thread
From: Jeff Sturm @ 2000-03-15  7:06 UTC (permalink / raw)
  To: Axel Riese; +Cc: Øystein O Johansen, Cygwin Mailing List

Axel Riese wrote:
> Yes, clear. But I have my doubts that one can get an undefined reference
> due to a missing declaration.

Sure you can, because the __stdcall modifier alters the linkage name of
the symbol.

> Anyway, adding -mwindows or -luser32
> should solve the problem.

IIRC the undefined symbol was 'IsWindowVisible', which is a symptom of a
different problem.  That symbol isn't defined in any Win32 library...
'IsWindowVisible@4' is.

-- 
Jeff Sturm
jsturm@sigma6.com

--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: Linking problem: IsWindowVisible
  2000-03-15  6:58       ` Axel Riese
@ 2000-03-15  7:02         ` Chris Faylor
  2000-03-15  7:06         ` Jeff Sturm
  1 sibling, 0 replies; 14+ messages in thread
From: Chris Faylor @ 2000-03-15  7:02 UTC (permalink / raw)
  To: Cygwin Mailing List

On Wed, Mar 15, 2000 at 03:57:56PM +0100, Axel Riese wrote:
>> > Hm, in this case you should have problems at compile time, not at
>> > link time, shouldn't you ?
>> 
>> Not necessarily.  In the absence of a declaration, C will guess "int
>> IsWindowVisible()", which in this case is wrong.
>> 
>> BTW you can catch such problems by compiling with -Wall:
>
>Yes, clear. But I have my doubts that one can get an undefined reference
>due to a missing declaration. Anyway, adding -mwindows or -luser32
>should solve the problem.

Your doubts are wrong.  If you haven't declared the function correctly
this is exactly what you'll get.

cgf

--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: Linking problem: IsWindowVisible
  2000-03-15  6:48     ` Jeff Sturm
@ 2000-03-15  6:58       ` Axel Riese
  2000-03-15  7:02         ` Chris Faylor
  2000-03-15  7:06         ` Jeff Sturm
  0 siblings, 2 replies; 14+ messages in thread
From: Axel Riese @ 2000-03-15  6:58 UTC (permalink / raw)
  To: Jeff Sturm; +Cc: Øystein O Johansen, Cygwin Mailing List

> > Hm, in this case you should have problems at compile time, not at
> > link time, shouldn't you ?
> 
> Not necessarily.  In the absence of a declaration, C will guess "int
> IsWindowVisible()", which in this case is wrong.
> 
> BTW you can catch such problems by compiling with -Wall:

Yes, clear. But I have my doubts that one can get an undefined reference
due to a missing declaration. Anyway, adding -mwindows or -luser32
should solve the problem.

- Axel

=======================================================================
Axel Riese
Research Institute for Symbolic Computation
J. Kepler University Linz                     Tel: +43 (0)732 2468 9939
Altenbergerstrasse 69                         Fax: +43 (0)732 2468 9930
A-4040 Linz                      e-Mail: Axel.Riese@risc.uni-linz.ac.at
Austria              http://www.risc.uni-linz.ac.at/people/ariese/home/
=======================================================================

--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: Linking problem: IsWindowVisible
  2000-03-15  6:39   ` Axel Riese
@ 2000-03-15  6:48     ` Jeff Sturm
  2000-03-15  6:58       ` Axel Riese
  0 siblings, 1 reply; 14+ messages in thread
From: Jeff Sturm @ 2000-03-15  6:48 UTC (permalink / raw)
  To: Axel Riese; +Cc: Øystein O Johansen, Cygwin Mailing List

Axel Riese wrote:
> > > Yes, I worked that out by self. But I still get undefined
> > > reference to 'IsWindowVisible' ?
> >
> > You may be missing a declaration for IsWindowVisible.  Does the source
> > file have #include <windows.h> anywhere?
>
> Hm, in this case you should have problems at compile time, not at
> link time, shouldn't you ?

Not necessarily.  In the absence of a declaration, C will guess "int
IsWindowVisible()", which in this case is wrong.

BTW you can catch such problems by compiling with -Wall:

jcs.c:4: warning: implicit declaration of function `IsWindowVisible'

-- 
Jeff Sturm
jsturm@sigma6.com

--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: Linking problem: IsWindowVisible
  2000-03-15  6:32 ` Jeff Sturm
@ 2000-03-15  6:39   ` Axel Riese
  2000-03-15  6:48     ` Jeff Sturm
  0 siblings, 1 reply; 14+ messages in thread
From: Axel Riese @ 2000-03-15  6:39 UTC (permalink / raw)
  To: Jeff Sturm; +Cc: Øystein O Johansen, Cygwin Mailing List

> > Yes, I worked that out by self. But I still get undefined
> > reference to 'IsWindowVisible' ?
> 
> You may be missing a declaration for IsWindowVisible.  Does the source
> file have #include <windows.h> anywhere?

Hm, in this case you should have problems at compile time, not at
link time, shouldn't you ?

- Axel

=======================================================================
Axel Riese
Research Institute for Symbolic Computation
J. Kepler University Linz                     Tel: +43 (0)732 2468 9939
Altenbergerstrasse 69                         Fax: +43 (0)732 2468 9930
A-4040 Linz                      e-Mail: Axel.Riese@risc.uni-linz.ac.at
Austria              http://www.risc.uni-linz.ac.at/people/ariese/home/
=======================================================================

--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: Linking problem: IsWindowVisible
  2000-03-15  6:18 Earnie Boyd
@ 2000-03-15  6:34 ` Jeff Sturm
  0 siblings, 0 replies; 14+ messages in thread
From: Jeff Sturm @ 2000-03-15  6:34 UTC (permalink / raw)
  To: earnie_boyd
  Cc: Øystein_O_Johansen, Cygwin Mailing List,
	Axel Riese

Earnie Boyd wrote:
> Use the -mwindows switch.  It'll add the necessary libraries to the build.

True... although with -mwindows you lose the text console, which is not
always what you want (I always print debug messages to stderr... but
hey, I'm a Unix guy at heart).

-- 
Jeff Sturm
jsturm@sigma6.com

--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: Linking problem: IsWindowVisible
  2000-03-15  6:12 Øystein O Johansen
  2000-03-15  6:17 ` Axel Riese
@ 2000-03-15  6:32 ` Jeff Sturm
  2000-03-15  6:39   ` Axel Riese
  1 sibling, 1 reply; 14+ messages in thread
From: Jeff Sturm @ 2000-03-15  6:32 UTC (permalink / raw)
  To: Øystein O Johansen; +Cc: Cygwin Mailing List, Axel Riese

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 458 bytes --]

Øystein O Johansen wrote:
> Yes, I worked that out by self. But I still get undefined
> reference to 'IsWindowVisible' ?

You may be missing a declaration for IsWindowVisible.  Does the source
file have #include <windows.h> anywhere?

(Win32 API functions must be declared with __stdcall, that's where the
@4 comes from).

-- 
Jeff Sturm
jsturm@sigma6.com

--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: Linking problem: IsWindowVisible
@ 2000-03-15  6:18 Earnie Boyd
  2000-03-15  6:34 ` Jeff Sturm
  0 siblings, 1 reply; 14+ messages in thread
From: Earnie Boyd @ 2000-03-15  6:18 UTC (permalink / raw)
  To: Øystein_O_Johansen, Cygwin Mailing List; +Cc: Axel Riese

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 880 bytes --]

--- Øystein_O_Johansen <OJOHANS@statoil.com> wrote:
> >> I got a program thet uses IsWindowVisible. I think this is a
> >> standard Win API function. But what to link it with? -lgdi32 fails.
> 
> > According to MS's online docu, it's -luser32.
> 

Use the -mwindows switch.  It'll add the necessary libraries to the build.

 

=====
---
   Earnie Boyd: < mailto:earnie_boyd@yahoo.com >
            __Cygwin: POSIX on Windows__
Cygwin Newbies: < http://www.freeyellow.com/members5/gw32/index.html >
           __Minimalist GNU for Windows__
  Mingw32 List: < http://www.egroups.com/group/mingw32/ >
    Mingw Home: < http://www.mingw.org/ >

__________________________________________________
Do You Yahoo!?
Talk to your friends online with Yahoo! Messenger.
http://im.yahoo.com

--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: Linking problem: IsWindowVisible
  2000-03-15  6:12 Øystein O Johansen
@ 2000-03-15  6:17 ` Axel Riese
  2000-03-15  6:32 ` Jeff Sturm
  1 sibling, 0 replies; 14+ messages in thread
From: Axel Riese @ 2000-03-15  6:17 UTC (permalink / raw)
  To: "Øystein O Johansen"; +Cc: cygwin

> Yes, I worked that out by self. But I still get undefined
> reference to 'IsWindowVisible' ?
> 
> I even tried to remake the import library file (libuser32.a) from
> the user32.def file and the user32.dll. Yes, user32.def does
> include IsWindowVisible@4 in line 345, but it still doesn't link.

Sounds strange. How do you invoke gcc for compiling and linking ?

- Axel

=======================================================================
Axel Riese
Research Institute for Symbolic Computation
J. Kepler University Linz                     Tel: +43 (0)732 2468 9939
Altenbergerstrasse 69                         Fax: +43 (0)732 2468 9930
A-4040 Linz                      e-Mail: Axel.Riese@risc.uni-linz.ac.at
Austria              http://www.risc.uni-linz.ac.at/people/ariese/home/
=======================================================================

--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: Linking problem: IsWindowVisible
@ 2000-03-15  6:12 Øystein O Johansen
  2000-03-15  6:17 ` Axel Riese
  2000-03-15  6:32 ` Jeff Sturm
  0 siblings, 2 replies; 14+ messages in thread
From: Øystein O Johansen @ 2000-03-15  6:12 UTC (permalink / raw)
  To: Cygwin Mailing List; +Cc: Axel Riese

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 589 bytes --]

>> I got a program thet uses IsWindowVisible. I think this is a
>> standard Win API function. But what to link it with? -lgdi32 fails.

> According to MS's online docu, it's -luser32.

Yes, I worked that out by self. But I still get undefined
reference to 'IsWindowVisible' ?

I even tried to remake the import library file (libuser32.a) from
the user32.def file and the user32.dll. Yes, user32.def does
include IsWindowVisible@4 in line 345, but it still doesn't link.

???

-Øystein



--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: Linking problem: IsWindowVisible
@ 2000-03-15  5:27 Axel Riese
  0 siblings, 0 replies; 14+ messages in thread
From: Axel Riese @ 2000-03-15  5:27 UTC (permalink / raw)
  To: Cygwin Mailing List; +Cc: OJOHANS

> I got a program thet uses IsWindowVisible. I think this is a
> standard Win API function. But what to link it with? -lgdi32 fails.

According to MS's online docu, it's -luser32.

- Axel


=======================================================================
Axel Riese
Research Institute for Symbolic Computation
J. Kepler University Linz                     Tel: +43 (0)732 2468 9939
Altenbergerstrasse 69                         Fax: +43 (0)732 2468 9930
A-4040 Linz                      e-Mail: Axel.Riese@risc.uni-linz.ac.at
Austria              http://www.risc.uni-linz.ac.at/people/ariese/home/
=======================================================================

--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Linking problem: IsWindowVisible
@ 2000-03-15  4:58 Øystein O Johansen
  0 siblings, 0 replies; 14+ messages in thread
From: Øystein O Johansen @ 2000-03-15  4:58 UTC (permalink / raw)
  To: cygwin

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 289 bytes --]

Hi!
I got a program thet uses IsWindowVisible. I think this is a
standard Win API function. But what to link it with? -lgdi32 fails.

undefined reference to 'IsWindowVisible'

-Øystein



--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com

^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2000-03-15  7:12 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-03-15  7:07 Linking problem: IsWindowVisible Øystein O Johansen
  -- strict thread matches above, loose matches on Subject: below --
2000-03-15  6:18 Earnie Boyd
2000-03-15  6:34 ` Jeff Sturm
2000-03-15  6:12 Øystein O Johansen
2000-03-15  6:17 ` Axel Riese
2000-03-15  6:32 ` Jeff Sturm
2000-03-15  6:39   ` Axel Riese
2000-03-15  6:48     ` Jeff Sturm
2000-03-15  6:58       ` Axel Riese
2000-03-15  7:02         ` Chris Faylor
2000-03-15  7:06         ` Jeff Sturm
2000-03-15  7:12           ` Axel Riese
2000-03-15  5:27 Axel Riese
2000-03-15  4:58 Øystein O Johansen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).