public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* libglut is missing library for MinGW static linking
@ 2018-09-27 13:42 Matt D.
  2018-09-27 18:20 ` cyg Simple
  0 siblings, 1 reply; 2+ messages in thread
From: Matt D. @ 2018-09-27 13:42 UTC (permalink / raw)
  To: cygwin

libglut-devel provides libglut.a and libglut.dll.a but linking libglut.a 
with either "-lglut" or "-lglut.dll" both depend on either cygglut-3.dll 
or libglut-0.dll respectively when compiling for Cygwin or MinGW.

I understand that this isn't a big deal for Cygwin binaries as it's not 
possible to statically link those executables anyways. But glut has the 
ability to link statically and this is of benefit on Windows with MinGW 
for convenience and ease of distribution.

To perform static linking against glut, I have to download 
"libfreeglut_static.a" as provided by http://freeglut.sourceforge.net. I 
can still use libglut but the static library provides the missing 
dependencies to mitigate the need for the shared library.

I can compile as such:

i686-w64-mingw32-g++.exe -DFREEGLUT_STATIC main.cpp -lglut 
-lfreeglut_static -lgdi32 -lwinmm -lglu32 -lopengl32 -L. -oa.out

The resulting executable is completely static and stand-alone and does 
not require a shared library. The key here is the define 
"FREEGLUT_STATIC" along with libfreeglut_static provided from the 
freeglut website.

I don't know what Cygwin's policy is on providing static libraries for 
MinGW but this is a very good candidate as it already has all of the 
necessary declarations defined.


Matt D.

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

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

end of thread, other threads:[~2018-09-27 18:20 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-09-27 13:42 libglut is missing library for MinGW static linking Matt D.
2018-09-27 18:20 ` cyg Simple

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