public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* Re: linking with glut32.lib?
@ 2001-12-19  8:23 Andre Bleau
  2001-12-19 12:30 ` sscanf %as broken (was: linking with glut32.lib?) Mark Sheppard
  0 siblings, 1 reply; 3+ messages in thread
From: Andre Bleau @ 2001-12-19  8:23 UTC (permalink / raw)
  To: cygwin


>Hi,
>
>I'm trying to get a GLUT application compiled under cygwin and am
>having a spot of bother.  I've got it going fine under Linux (my
>preferred platform - I try not to touch Windows if I can help it), but
>I'd like to have Windows users be able to run it too and Cygwin seemed
>the obvious choice.

GLUT support is already included in cygwin's openGL package.

>Anyway I've put glut32.{dll,lib} from
>http://www.xmission.com/~nate/glut/glut-3.7.6-bin.zip and

Scrap that. Use cygwin's openGL package instead.

>{glu,opengl}32.{dll,lib} from
>http://download.microsoft.com/download/win95upg/info/1/W95/EN-US/Opengl95.exe
>in /usr/local/lib and then tried to link it like this:
>
>   gcc *.o /usr/local/lib/glut32.lib /usr/local/lib/opengl32.lib \
>     /usr/local/lib/glu32.lib -lm -o program
>
>but I get errors like this:
>
>   whatever.o:123: undefined reference to `glutInit@8'

Wrong glut.h; glut functions are not properly declared; that leads to 
linking problems.


>so am I right in thinking there's something wrong with glut32.lib?
>All the references to functions in opengl32.lib and glu32.lib resolve
>OK, but not any to the functions in glut32.lib.  How can I fix this or
>is there a different glut32.{dll,lib} that I should be using?
>
>Thanks for any assistance,
>Mark.

After you install cygwin's openGL package, please read 
/usr/doc/opengl-1.1.0/README.txt for usefull clues.


André Bleau, Cygwin's OpenGL package maintainer.

email: bleau at igb dot umontreal dot ca
(Fight SPAM: encode your email-address)



--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

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

* sscanf %as broken (was: linking with glut32.lib?)
  2001-12-19  8:23 linking with glut32.lib? Andre Bleau
@ 2001-12-19 12:30 ` Mark Sheppard
  2001-12-20  0:41   ` Pavel Tsekov
  0 siblings, 1 reply; 3+ messages in thread
From: Mark Sheppard @ 2001-12-19 12:30 UTC (permalink / raw)
  To: cygwin

On 2001-12-19 (Wednesday) at 11:13:01 -0500, Andre Bleau wrote:
> 
> >I'm trying to get a GLUT application compiled under cygwin and am
> >having a spot of bother.  [...]
> 
> GLUT support is already included in cygwin's openGL package.

Thanks for that.  I hadn't realised GLUT and OpenGL were supported out
of the box like that.  I'd done some Googling trying to find
instructions for compiling GLUT programs and nothing I came across
mentioned an OpenGL Cygwin package.  Next time I'll read the package
list more carefully!

Anyway I've now got it compiling cleanly, but there's a totally
unrelated runtime error which after investigation looks like it's
caused by sscanf(3) not working properly with "%as".  The following
code which works under Linux (sscanf returns 1) but not under Cygwin
(sscanf returns 0) demonstrates the problem:


  #include <stdio.h>

  int main(int argc, char *argv[]){
    char *string = "This is a string\n";
    char *word;

    if(!sscanf(string, "%as", &word)){
      fprintf(stderr, "No string in string.\n");
    }
    else{
      printf("Found `%s' in string.\n", word);
    }
    return 0;
  }


Mark.

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

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

* Re: sscanf %as broken (was: linking with glut32.lib?)
  2001-12-19 12:30 ` sscanf %as broken (was: linking with glut32.lib?) Mark Sheppard
@ 2001-12-20  0:41   ` Pavel Tsekov
  0 siblings, 0 replies; 3+ messages in thread
From: Pavel Tsekov @ 2001-12-20  0:41 UTC (permalink / raw)
  To: Mark Sheppard; +Cc: cygwin

The man page of the glibc sscanf explains it all - see this:

 a      Indicates  that  the  conversion  will  be  s,  the needed
memory space for the string will be malloc'ed  and the
              pointer to it will be assigned to the char pointer
variable, which does not have to be initialised before.   This
              flag does not exist in ANSI C.

In other words this is a glibc artifact and cygwin uses newlib
as its C runtime library.

Mark Sheppard wrote:
> 
> On 2001-12-19 (Wednesday) at 11:13:01 -0500, Andre Bleau wrote:
> >
> Anyway I've now got it compiling cleanly, but there's a totally
> unrelated runtime error which after investigation looks like it's
> caused by sscanf(3) not working properly with "%as".  The following
> code which works under Linux (sscanf returns 1) but not under Cygwin
> (sscanf returns 0) demonstrates the problem:

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

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

end of thread, other threads:[~2001-12-20  8:38 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-12-19  8:23 linking with glut32.lib? Andre Bleau
2001-12-19 12:30 ` sscanf %as broken (was: linking with glut32.lib?) Mark Sheppard
2001-12-20  0:41   ` Pavel Tsekov

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).