From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 118783 invoked by alias); 27 Sep 2018 13:42:51 -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 118775 invoked by uid 89); 27 Sep 2018 13:42:51 -0000 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 Received: from mail-pf1-f172.google.com (HELO mail-pf1-f172.google.com) (209.85.210.172) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 27 Sep 2018 13:42:49 +0000 Received: by mail-pf1-f172.google.com with SMTP id x17-v6so1962740pfh.5 for ; Thu, 27 Sep 2018 06:42:49 -0700 (PDT) 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== Return-Path: Received: from [10.0.1.133] (ip68-9-107-17.ri.ri.cox.net. [68.9.107.17]) by smtp.gmail.com with ESMTPSA id d19-v6sm4018975pgi.50.2018.09.27.06.42.46 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 27 Sep 2018 06:42:46 -0700 (PDT) From: "Matt D." To: cygwin@cygwin.com Reply-To: codespunk+cygwin@gmail.com Subject: libglut is missing library for MinGW static linking Message-ID: <34b0c5f5-1d4a-4ba6-c2ec-f0b105b590cb@gmail.com> Date: Thu, 27 Sep 2018 13:42:00 -0000 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 X-SW-Source: 2018-09/txt/msg00271.txt.bz2 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