From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 98693 invoked by alias); 27 Sep 2018 18:20:44 -0000 Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@cygwin.com Mail-Followup-To: cygwin@cygwin.com Received: (qmail 98681 invoked by uid 89); 27 Sep 2018 18:20:43 -0000 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 Received: from mail-it1-f178.google.com (HELO mail-it1-f178.google.com) (209.85.166.178) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 27 Sep 2018 18:20:42 +0000 Received: by mail-it1-f178.google.com with SMTP id j81-v6so9102409ite.0 for ; Thu, 27 Sep 2018 11:20:42 -0700 (PDT) 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== Return-Path: Received: from [192.168.0.3] (d47-69-109-131.nap.wideopenwest.com. [69.47.131.109]) by smtp.gmail.com with ESMTPSA id f15-v6sm2541646ita.24.2018.09.27.11.20.39 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 27 Sep 2018 11:20:39 -0700 (PDT) Subject: Re: libglut is missing library for MinGW static linking To: cygwin@cygwin.com References: <34b0c5f5-1d4a-4ba6-c2ec-f0b105b590cb@gmail.com> From: cyg Simple Openpgp: preference=signencrypt Message-ID: Date: Thu, 27 Sep 2018 18:20:00 -0000 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> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-IsSubscribed: yes X-SW-Source: 2018-09/txt/msg00280.txt.bz2 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