X-Recipient: archive-cygwin AT delorie DOT com
DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id
	:list-unsubscribe:list-subscribe:list-archive:list-post
	:list-help:sender:from:to:reply-to:subject:message-id:date
	:mime-version:content-type:content-transfer-encoding; q=dns; s=
	default; b=Gs/L67kB1UVpO08bJ7bmqgDX7W+Q5R2UYrwkG2mSczI1+kE/Ug68f
	AOqcBPIQUHPEpzbJAnFNLREcy1QEynPSrOtrW9Fp2E0xYwr3hbZ0p/gPgXWzW5no
	ligA/dMwXeegb/yhTcFc18vZf+XdAqMpIHIfRkrsBcLHFlLGLztEWU=
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id
	:list-unsubscribe:list-subscribe:list-archive:list-post
	:list-help:sender:from:to:reply-to:subject:message-id:date
	:mime-version:content-type:content-transfer-encoding; s=default;
	 bh=Pq7KUtcLAzmlEaEQX5LtQSa8awk=; b=ebfwsiYu97lCKjLtZ8q6iQWQ2bKE
	nlyXZ77YTEedfoW8YGfGZL6Ma+2NTWB5CWORTZilfvmlSJhs6iieetPCi3ky03Ei
	wEiNbY9ZFQVD8MUcE/6CcQ9gOhBhNkaRdwBXX1ouLozUtaLNQd8Ejv3uYkS3avGO
	z0Rd6PTA1l6pBLU=
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/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
Authentication-Results: sourceware.org; auth=none
X-Spam-SWARE-Status: No, score=-0.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM,FREEMAIL_REPLYTO,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=no version=3.3.2 spammy=main.cpp, statically, UD:main.cpp, maincpp
X-HELO: mail-pf1-f172.google.com
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;        d=gmail.com; s=20161025;        h=from:to:reply-to:subject:message-id:date:user-agent:mime-version         :content-language:content-transfer-encoding;        bh=vp3VIEo6AeI8+KXc3O1fzPBU9j4Lq99wHVY09aMGSR0=;        b=nvdimH6gNNVLrl3LWlcr7+vdC9DH/WFxqZ/WdvrlleY4I4n451DIyXAjfrP16UYYnT         ufWROhTVNO2wka0kAX1samQC3NBguQb3nm6nRjV510/l2zMTasRK+UGRglR0CrMIp8+2         Ne1DAjPxQBF1oOHS+QoatBD/LQnGi+KMVLBT1jjQb9g3hWKidE5TTizBlt5gy1O0DEV3         XmatM0FZx90Q8sSspD923tWMOCAY5AxLy6dp09wv5AZ+jEKEw7AzGZv90a8V1ATbPW0M         I1F7tpZFV5MNSRfyiEKxfttWtugNwhHkxV9OgcGyETGGkHgkF5V/jI/RqXkH8m0FaMMc         XHNQ==
From: "Matt D." <codespunk AT gmail DOT com>
To: cygwin AT cygwin DOT com
Reply-To: codespunk+cygwin AT gmail DOT com
Subject: libglut is missing library for MinGW static linking
Message-ID: <34b0c5f5-1d4a-4ba6-c2ec-f0b105b590cb@gmail.com>
Date: Thu, 27 Sep 2018 09:40:18 -0400
User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit

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