From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 124643 invoked by alias); 25 Feb 2016 04:29:52 -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 124628 invoked by uid 89); 25 Feb 2016 04:29:52 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=1.8 required=5.0 tests=AWL,BAYES_60,KAM_LAZY_DOMAIN_SECURITY autolearn=no version=3.3.2 spammy=H*r:ip*192.168.1.100, coff, NPOTAdlg.o, npotadlg.o X-HELO: m0.truegem.net Received: from m0.truegem.net (HELO m0.truegem.net) (69.55.228.47) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Thu, 25 Feb 2016 04:29:50 +0000 Received: (from daemon@localhost) by m0.truegem.net (8.12.11/8.12.11) id u1P4TTr3061084 for ; Wed, 24 Feb 2016 20:29:29 -0800 (PST) (envelope-from mark@maxrnd.com) Received: from 76-217-5-154.lightspeed.irvnca.sbcglobal.net(76.217.5.154), claiming to be "[192.168.1.100]" via SMTP by m0.truegem.net, id smtpdwLd525; Wed Feb 24 20:29:19 2016 Subject: Re: Can't link .res file (from windres) using i686-pc-mingw32-g++ To: cygwin@cygwin.com References: From: Mark Geisert Message-ID: <56CE833C.2040200@maxrnd.com> Date: Thu, 25 Feb 2016 04:29:00 -0000 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:42.0) Gecko/20100101 Firefox/42.0 SeaMonkey/2.39 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2016-02/txt/msg00389.txt.bz2 Jim Reisert AD1C wrote: > I have a 64-bit Cygwin environment. I'm trying to compile a 32-bit > (target) Windows program using i686-pc-mingw32-g++ > > # i686-pc-mingw32-g++ -g -Wall -Iinclude -I../../library/include -c > -o NPOTAdlg.o NPOTAdlg.cpp > # windres -Iinclude res/NPOTAdlg.rc -O coff -o res/NPOTAdlg.res > # i686-pc-mingw32-g++ -s -mwindows -static-libgcc -static-libstdc++ > -lwininet NPOTA.o NPOTAdlg.o res/NPOTAdlg.res ../../library/library.a > /usr/i686-pc-mingw32/sys-root/mingw/lib/libwininet.a -o NPOTA > > But I get this error on the link (last) step: > > res/NPOTAdlg.res: file not recognized: File format not recognized > > This program is a clone of another program I wrote a couple of years > ago (I wanted to re-use the Windows framework I had developed). > However, at that time, I was using 32-bit Cygwin, not 64-bit Cygwin. > > Is there a work-around for this, other than re-creating a 32-bit > Cygwin environment? Just a guess: your 64-bit windres is generating a 64-bit .res file that the 32-bit g++ can't grok. Look at 'windres -h'. There's a "-F" == "--target" flag that can specify a target type. I would try adding "-F pe-i386" after the "-O coff" on your command. If windres doesn't accept both -O and -F, try leaving off the "-O coff" and just specify the -F flag and value. Good luck. ..mark -- 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