delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2018/09/27/14:20:55

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:subject:to:references:from:message-id:date
:mime-version:in-reply-to:content-type
:content-transfer-encoding; q=dns; s=default; b=BToxjO1yEGA7iVII
2yUzzpq9nSke7dwjaTuTCHG3v+dUmFfEtUn06ID+TjjuktsbrIDkH8FMlPWXAAUA
fjO1DfTJPHcrg4az3rv2XY5STOaINOZn4WSHiNXWOSwMU22+2+QxCH1U5PUC0nB3
6CUNIiglD/Td8RSlP01HsHF02iw=
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:subject:to:references:from:message-id:date
:mime-version:in-reply-to:content-type
:content-transfer-encoding; s=default; bh=RDGf5vZWgQjvHGJMJ4ONbe
Jhu+Y=; b=POzDkxuravAI4/kUtjlVHYjxRdeVSJ3FgUyLPXJOE5p5PciaT6xAt6
m1yJKjRqoG0HpazOZcqkVQYZrFoLnKtV+cGY6ks/t+ZAQvNZiUwL5jCcBG+iMce4
mJlzPzOpRnWO0gzclZKdUG+mweA6ywu/c6xnyH0NWIH+tHCgTm8+A=
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=-1.9 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.2 spammy=directed, fashion, statically, UD:main.cpp
X-HELO: mail-it1-f178.google.com
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:references:from:openpgp:autocrypt:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=MKSftmrAV0SsX5PoHD0Hfdzp9N/tQhWZdz4QV3hKGoY=; b=DAcvt0WaAA1MlMmvQYyptlr2ilOqIZF3joa6s6E42nDtTiavBEUFfkgj5TrMnKQ+5v RlKB8yUnBki7u22MqESuemtxUECFvnAfRald7TqcHv3neNsTyKd6nOnHrb0QnlPrui2K fEWMCovfSljKb7GOe+wHBEByWekNyYyqQC4xbPHiZmj2ZyyyCDmQQDsDvZ2UMGzJoI7v Wu6gMM9iPsQCFinH/VtI7NXQ3JTOFHtclSWsZTvw8xOGmacFr5y5acntUUYz98YtapTH +J+4D/LzYrwwKncAPzQZMWsL8d7R4VGumMr++z9/Nqk8fsb+B5EaxvL8i75pbmPHzNA/ o50A==
Subject: Re: libglut is missing library for MinGW static linking
To: cygwin AT cygwin DOT com
References: <34b0c5f5-1d4a-4ba6-c2ec-f0b105b590cb AT gmail DOT com>
From: cyg Simple <cygsimple AT gmail DOT com>
Openpgp: preference=signencrypt
Message-ID: <b86e279b-8cdd-e70f-4d50-be2573e7f9ea@gmail.com>
Date: Thu, 27 Sep 2018 14:20:36 -0400
User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1
MIME-Version: 1.0
In-Reply-To: <34b0c5f5-1d4a-4ba6-c2ec-f0b105b590cb@gmail.com>
X-IsSubscribed: yes

On 9/27/2018 9:40 AM, Matt D. wrote:
> 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.
> 

Unless you've directed the build process to use static libraries the
default choice is dynamic.  So -lglut and -lglut.dll are both one and
the same for -lglut will look for -lglut.dll and use it instead.

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

You could use /usr/lib/libglut.a in the same fashion.  You can verify if
the library actually is a static library using `nm /usr/lib/libglut.a |
grep _imp_`; if any _imp_ return from the grep then this isn't a static
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.
You would need to follow the protocol for getting a package accepted.
See the FAQ for that information.

-- 
cyg Simple

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

- Raw text -


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