delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2003/10/22/10:47:22

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Message-Id: <5.2.0.9.0.20031022102925.02d6f3e8@irispavp.igb.umontreal.ca>
X-Sender: bleau3 AT irispavp DOT igb DOT umontreal DOT ca (Unverified)
Date: Wed, 22 Oct 2003 10:46:16 -0400
To: cygwin AT cygwin DOT com
From: Andre Bleau <bleau AT igb DOT umontreal DOT ca>
Subject: Re: OpenGL and Cygwin
Mime-Version: 1.0
X-MDRemoteIP: 10.52.50.2
X-Return-Path: bleau AT igb DOT umontreal DOT ca
X-MDaemon-Deliver-To: cygwin AT cygwin DOT com
X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id h9MElDmq030552

suresh at research dot att dot com wrote:

>As per Andre's suggestion, i compiled and ran the attached program. Below
>are the outputs under different system settings:
>
>All programs run from tcsh inside cygwin. My LD_LIBRARY_PATH also had my
>current dir, because I had the nvidia glut32.dll and glut32.lib files in
>it (which work when compiled with visual C++ on a different machine - I
>tried one of their demos)

Forget about LD_LIBRARY_PATH; it is not used by cygwin.


>This was the first run, just from scratch with no extra parameters.
>
>----------------------------------------------------------------------
>[Root AT euclid ~/src]$ g++ -o helloglut opengltest.c -lglut32 -lglu32 -
>lopengl32
>/tmp/ccwy9vdk.o(.text+0xe):opengltest.c: undefined reference to `_glClear'
>/tmp/ccwy9vdk.o(.text+0x4c):opengltest.c: undefined reference to
>`_glutInit'
>/tmp/ccwy9vdk.o(.text+0x58):opengltest.c: undefined reference to
>`_glutCreateWin
>dow'
>/tmp/ccwy9vdk.o(.text+0x64):opengltest.c: undefined reference to
>`_glutDisplayFu
>nc'
>/tmp/ccwy9vdk.o(.text+0x69):opengltest.c: undefined reference to
>`_glutMainLoop'
>
>collect2: ld returned 1 exit status
>---------------------------------------------------------------------

The error messages above make it clear: you are using the wrong headers. 
Cygwin's OpenGL headers would have generated messages like:

$ g++ helloGlut.c -o helloGlut
/cygdrive/c/DOCUME~1/bleau/LOCALS~1/Temp/cc99dyy4.o(.text+0xe):helloGlut.c: 
unde
fined reference to `_glClear AT 4'
/cygdrive/c/DOCUME~1/bleau/LOCALS~1/Temp/cc99dyy4.o(.text+0x50):helloGlut.c: 
und
efined reference to `_glutInit AT 8'
/cygdrive/c/DOCUME~1/bleau/LOCALS~1/Temp/cc99dyy4.o(.text+0x5f):helloGlut.c: 
und
efined reference to `_glutCreateWindow AT 4'
/cygdrive/c/DOCUME~1/bleau/LOCALS~1/Temp/cc99dyy4.o(.text+0x6e):helloGlut.c: 
und
efined reference to `_glutDisplayFunc AT 4'
/cygdrive/c/DOCUME~1/bleau/LOCALS~1/Temp/cc99dyy4.o(.text+0x76):helloGlut.c: 
und
efined reference to `_glutMainLoop AT 0'
collect2: ld returned 1 exit status

Notice the @4, @8, and @0 after the names.

You said in a previous message that you downloaded headers from NVDIA's 
site. If you are using these, that's the source of the problem. They are 
incompatible with gcc and g++ because they do not specify the right calling 
convention.

My advice: ditch those headers and use the ones from Cygwin's OpenGL 
package, or the ones from Cygwin's w32api package.

Alternative: modify NVDIA's headers to specify the right calling convention 
by adding

__attribute__ ((__stdcall__))

to the declaration of the functions. However, if you choose that path, do 
not expect anymore help from me; I am not going to support people who 
replace headers from Cygwin packages with headers from third parties. You 
would have to go to NVDIA's site for support.



André Bleau, Cygwin's OpenGL package maintainer.

Please address all questions and problem reports about Cygwin's OpenGL 
package to cygwin AT cygwin DOT com . 


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


- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019