Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com
Message-ID: <00c801c2c0a8$605dbd70$70eaec82@mindcooler>
From: =?iso-8859-1?Q?Mikael_=C5sberg?= <mikas493@student.liu.se>
To: <cygwin@cygwin.com>
References: <Pine.GSO.4.44.0301201203120.10883-100000@slinky.cs.nyu.edu>
Subject: Re: Building opengl applications
Date: Mon, 20 Jan 2003 18:21:32 +0100
MIME-Version: 1.0
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: 8bit
X-Priority: 3
X-MSMail-Priority: Normal
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1123
X-Spam-Status: No, hits=-5.3 required=5.0
	tests=FROM_ENDS_IN_NUMS,GAPPY_TEXT,INVALID_MSGID,
	      LIU_FROM_MATCHES_LIUSTUDENT,LIU_MAILTO_TO_LIUSTUDENT,
	      MAILTO_TO_SPAM_ADDR,QUOTED_EMAIL_TEXT,REFERENCES,
	      SPAM_PHRASE_01_02,USER_AGENT_OE
	version=2.41-liu_1.3
X-Spam-Level: 


----- Original Message ----- 
From: "Igor Pechtchanski" <pechtcha@cs.nyu.edu>
To: "Mikael Åsberg" <mikas493@student.liu.se>
Cc: <cygwin@cygwin.com>
Sent: Monday, January 20, 2003 6:09 PM
Subject: RE: Building opengl applications


> On Mon, 20 Jan 2003, [iso-8859-1] Mikael Åsberg wrote:
>
> > ----- Original Message -----
> > From: "Igor Pechtchanski" <pechtcha@cs.nyu.edu>
> > To: "Mikael Åsberg" <mikas493@student.liu.se>
> > Cc: <cygwin@cygwin.com>
> > Sent: Monday, January 20, 2003 5:45 PM
> > Subject: Re: Building opengl applications
> >
> >
> > > On Mon, 20 Jan 2003, [iso-8859-1] Mikael Åsberg wrote:
> > >
> > > > Hello, I am trying to build a simple OpenGL program (an example
taken from
> > > > the famous "Red Book"). However, during the build process the
following
> > > > error messages are displayed:
> > > >
> > > >
/cygdrive/c/DOCUME~1/ADMINI~1/LOCALS~1/Temp/ccK0lHn2.o(.text+0xe):test.c:
undefined reference to `glEnableClientState@4'
> > > >
/cygdrive/c/DOCUME~1/ADMINI~1/LOCALS~1/Temp/ccK0lHn2.o(.text+0x1d):test.c:
undefined reference to `glEnableClientState@4'
> > > >
/cygdrive/c/DOCUME~1/ADMINI~1/LOCALS~1/Temp/ccK0lHn2.o(.text+0x44):test.c:
undefined reference to `glVertexPointer@16'
> > > >
/cygdrive/c/DOCUME~1/ADMINI~1/LOCALS~1/Temp/ccK0lHn2.o(.text+0x6b):test.c:
undefined reference to `glColorPointer@16'
> > > >
/cygdrive/c/DOCUME~1/ADMINI~1/LOCALS~1/Temp/ccK0lHn2.o(.text+0x92):test.c:
undefined reference to `glInterleavedArrays@12'
> > > >
> > > > Actually, there is more, but each error is an undefined reference so
it
> > > > seems gcc cannot find
> > > > the libraries. I did install them, though.
> > > > Building with -glut32 -lglu32 -lopengl32
> > > >
> > > > What am I doing wrong?
> > > >
> > > > Hope you can help me =)
> > > >
> > > > // Mikael
> > > >
> > > > --
> > > > Bug reporting:         http://cygwin.com/bugs.html
> > > > Documentation:         http://cygwin.com/docs.html
> > > > FAQ:                   http://cygwin.com/faq/
> > >
> > > Mikael,
> > >
> > > Please note the last 3 lines above.  I'm sure at least some of the
> > > relevant information is contained there.  If not, at least they
contain a
> > > way of reporting your problem with the maximum of useful information
> > > (especially the first link of the three).  Without knowing the exact
> > > command line you gave to gcc and the packages you have installed,
there is
> > > no way to provide useful input.  Please peruse the instructions at the
> > > above links on how to report your problem properly.
> > > Igor
> > >
> > >
> > Apart from the base install, I have installed the opengl library and gcc
and
> > the packages it requires (cygwin, ash, binutils, w32api, mingw-runtime,
> > linintl2, gcc-mingw). I already gave the build command:
> > gcc -glut32 -lglu32 -lopengl32 -o test test.c
> >
> > Any other info needed? This is cygwin 1.3.18, packages were downloaded a
> > few weeks ago.
>
> Mikael,
>
> You still didn't read the bug reporting guidelines at
> <http://cygwin.com/bugs.html>.  For the future, please read them and
> follow them when posting.
>
> Now that you gave a *full* build command (which you most assuredly did not
> before), you have provided enough information to deduce the nature of your
> problem.  The order of arguments to gcc does matter.  The library
> containing a particular symbol should follow the object trying to use that
> symbol in the argument list.  Try
>
> gcc -o test test.c -glut32 -lglu32 -lopengl32
>
> You may also need to juggle the -l arguments to make this work.
> Igor
> -- 
> http://cs.nyu.edu/~pechtcha/
>       |\      _,,,---,,_ pechtcha@cs.nyu.edu
> ZZZzz /,`.-'`'    -.  ;-;;,_ igor@watson.ibm.com
>      |,4-  ) )-,_. ,\ (  `'-' Igor Pechtchanski
>     '---''(_/--'  `-'\_) fL a.k.a JaguaR-R-R-r-r-r-.-.-.  Meow!
>
> Oh, boy, virtual memory! Now I'm gonna make myself a really *big* RAMdisk!
>   -- /usr/games/fortune
>
>

Thanks, switching the order of the parameters worked. Now using
gcc -o test test.c -lopengl32 -lglu32 -lglut, and it compiles and links.
However, it crashed upon startup because it cannot find the file glut.dll
and that file is not in my system so I must have missed something. Haven't
worked with cygwin/gcc/opengl before.



--
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/

