delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2016/02/24/23:30:06

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=yZNXYi1uX8LcysDO
MHhxjjaLqyudmYPz+Fd6bWBzpGhLn70hO2g6d29r/uoIisci+HgzPAZrTxL3XlXH
vUpfQ868fCRgiNl6iPCBoQR2GfjRTEEOz4dRuaEHwDRxSOfYdqE1mtTaiYOopWIu
iFe2TuRHnXb4WZJeL1Sg/WnuGcQ=
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=sj7Mo3omHjgjhLOHrriVLq
5glP0=; b=m2/WrJxfP3AY6S9GNRsIYJh4kaNHCW94RGrFJpFUzBPjVMVD9JmeHM
SMmkiYXbTkWPtWh+c+64O/5SJ3+1LCKfQmI8+icYQe6dYr661SnfvCQk19Q0WAi6
Ps0F4IDu517XVCDFP/2VMTtCGeiH5gEymhNfSUKqA9NxHl5uSDz2g=
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-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
Subject: Re: Can't link .res file (from windres) using i686-pc-mingw32-g++
To: cygwin AT cygwin DOT com
References: <CAK-n8j6Uq2c-a_Vz1nWq3aZSH6L8yzq5xh3ipOPUqJ+yjPAaNw AT mail DOT gmail DOT com>
From: Mark Geisert <mark AT maxrnd DOT com>
Message-ID: <56CE833C.2040200@maxrnd.com>
Date: Wed, 24 Feb 2016 20:29:48 -0800
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: <CAK-n8j6Uq2c-a_Vz1nWq3aZSH6L8yzq5xh3ipOPUqJ+yjPAaNw@mail.gmail.com>

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

- Raw text -


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