public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: "André Bleau" <andre_bleau@hotmail.com>
To: <cygwin@cygwin.com>
Subject: Re: opengl-1.1.0-10 glut32 linking problems
Date: Thu, 29 Jan 2009 16:00:00 -0000	[thread overview]
Message-ID: <COL104-W16687026FDFFBFECCDCE2593C90@phx.gbl> (raw)


Hi Reini,
 
Reini Urban  wrote:
 
> The importlib /usr/lib/w32api/libglut32.a has some problems. Linking
> to the dll directly works fine.
> 
> $ cat test.c
> #include 
> #include 
> #include 
> int main(int argc, char *argv[])
> {
>     if(glutInit == NULL) {
>         printf("glutInit is NULL\n");
>         return EXIT_FAILURE;
>     }

I really don't know what you are trying to do with that test. glutInit is not called here, you're only checking the address of that function. As it is not loaded dynamically, it can only be different from NULL, otherwise linking would have failed.
 
>     printf("GLUT %d\n",        GLUT_API_VERSION);
>     return EXIT_SUCCESS;
> }
> $ gcc test.c -lglut32 -lglu -lopengl32
 
As stated in the opengl-1.1.0-9 and -10 anouncements and in 
/usr/share/doc/opengl-1.1.0/README.txt , you must now add
-I/usr/include/opengl at compile time to avoid conflicts with freeglut.
 
Also, the correct linking for glu is -lglu32. It didn't matter here, but it will when you
build a more elaborate program. Please check /usr/share/doc/opengl-1.1.0/README.txt .

> undefined reference to `___glutInitWithExit'
> undefined reference to `___glutCreateWindowWithExit'
> undefined reference to `___glutCreateMenuWithExit'
 
libglut32.a was part of the w32api package before version 3.13-1 . If you have 
w32api-3.12-1 or older, you're getting libglut32.a from the w32api package, not the one 
from the opengl package. The opengl package depends on the w32api package, so updating the
opengl package should have updated the w32api package first.
 
What is the result of:
cygcheck -c opengl
cygcheck -c w32api
cygcheck -c libglut3
cygcheck -c libglut-devel
?

> $ gcc test.c /bin/glut32.dll -lglu -lopengl32
> 
> $ ./a
> GLUT 3
> 
> Note that there are two more ___glut* functions, not only these three.
> $ nm /lib/w32api/libglut32.a | grep " ___glut"
> 00000000 T ___glutSetFCB@8
> 00000000 T ___glutInitWithExit@12
> 00000000 T ___glutGetFCB@4
> 00000000 T ___glutCreateWindowWithExit@8
> 00000000 T ___glutCreateMenuWithExit@8
> $ objdump -t /lib/w32api/libglut32.a | grep " ___glut"
> [  7](sec  1)(fl 0x00)(ty   0)(scl   2) (nx 0) 0x00000000 ___glutSetFCB@8
> [  7](sec  1)(fl 0x00)(ty   0)(scl   2) (nx 0) 0x00000000 ___glutInitWithExit@12
> [  7](sec  1)(fl 0x00)(ty   0)(scl   2) (nx 0) 0x00000000 ___glutGetFCB@4
> [  7](sec  1)(fl 0x00)(ty   0)(scl   2) (nx 0) 0x00000000
> ___glutCreateWindowWithExit@8
> [  7](sec  1)(fl 0x00)(ty   0)(scl   2) (nx 0) 0x00000000
> ___glutCreateMenuWithExit@8
> 
> I see nothing problematic, but I'm no expert
 
What is the output of ls -l /usr/lib/w32api/libglut32.a ?
 
It should match:
Fri Dec  5 15:57:41 2008          90472 usr/lib/w32api/libglut32.a
from the opengl-1.1.0-10 package; otherwise, you have the file from an old w32api package.
 
You can also try:
 
gcc test.c /usr/lib/w32api/libglut32.a -lglu32 -lopengl32
 
To check if -lglut32 leads to the right thing.

> -- 
> Reini Urban
 
HTH,
 
- André Bleau, Cygwin's volunteer OpenGL package maintainer.
 
Please direct any question or comment about the 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/

             reply	other threads:[~2009-01-29 15:13 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-01-29 16:00 André Bleau [this message]
  -- strict thread matches above, loose matches on Subject: below --
2009-02-06 19:24 André Bleau
2009-01-29  1:44 Reini Urban
2009-01-29  5:09 ` Reini Urban

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=COL104-W16687026FDFFBFECCDCE2593C90@phx.gbl \
    --to=andre_bleau@hotmail.com \
    --cc=cygwin@cygwin.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).